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

[dropconfig] Clean-up error output for devices that do not support drop counters #784

Merged
merged 1 commit into from
Jan 17, 2020

Conversation

daall
Copy link
Contributor

@daall daall commented Jan 16, 2020

Signed-off-by: Danny Allen [email protected]

- What I did
I fixed the if-check for devices that do not publish any drop counter capabilities to state DB.

- How I did it
I added a return inside the if-check so that the function will stop if no capabilities are found.

- How to verify it
I ran the show dropcounters capabilities command immediately after boot to ensure that the CAPABILITIES table would be empty, triggering the if-check.

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

admin@sonic:~$ show dropcounters capabilities
Traceback (most recent call last):
  File "/usr/bin/dropconfig", line 414, in <module>
    main()
  File "/usr/bin/dropconfig", line 409, in main
    dconfig.print_device_capabilities()
  File "/usr/bin/dropconfig", line 97, in print_device_capabilities
Current device does not support drop counters
    for counter, capabilities in device_caps.iteritems():
AttributeError: 'NoneType' object has no attribute 'iteritems'

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

admin@sonic:~$ show dropcounters capabilities
Current device does not support drop counters

@daall
Copy link
Contributor Author

daall commented Jan 16, 2020

retest this please

@daall daall merged commit 98e8795 into sonic-net:master Jan 17, 2020
@daall daall deleted the drop_counter_ui_fix branch January 17, 2020 02:05
abdosi pushed a commit that referenced this pull request Jan 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants