Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lldp-show: skip containers not in running state #1656

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mprabhu-nokia
Copy link
Contributor

With sonic-net/sonic-buildimage#7477 asic-dependent containers are created/started only when the ASIC is detected by the platform. The lldp show command throws exception/errors if some containers are not present.

What I did

Add an additional check for container to be in running state before processing additional container state information.

How I did it

Introduced a is_instance_running() routine which will use docker-inspect to check for the state of the container.

How to verify it

Verified using lldp show table command

Previous command output (if the output of a command-line utility has changed)

admin@Linecard3:~$ show lldp table
Error response from daemon: Container e19fbab07c3789790a38c9d3348ee7b9d766dfcdba4269ab5c2fb66a6de073d0 is not running
Error response from daemon: Container 5362b5ef03a0eabdbdf1702b4974eddf2d11b8f97901c4187a54388d16278ffa is not running
Error response from daemon: Container 2e47a66771aaa68301a05a823537912d14170371f9798347c6ce6da9bb9c9c64 is not running
Capability codes: (R) Router, (B) Bridge, (O) Other
LocalPort    RemoteDevice    RemotePortID    Capability    RemotePortDescr
-----------  --------------  --------------  ------------  -----------------
--------------------------------------------------
Total entries displayed:  0

New command output (if the output of a command-line utility has changed)

admin@Linecard3:~$ show lldp table

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants