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

"show run interfaces" returns traceback when no INTERFACE is present in configuration #4012

Closed
mkovnir opened this issue Jan 10, 2020 · 0 comments
Assignees

Comments

@mkovnir
Copy link

mkovnir commented Jan 10, 2020

Description

CLI command "show run acl" returns traceback when no INTERFACE is present in configuration

Steps to reproduce the issue:

  1. Assure your configuration doesnt have "INTERFACE" section - CLI command show run all | grep -e '"INTERFACE"' should return nothing.
  2. Issue CLI command "show run acl"

Describe the results you received:
root@sonic:/home/admin# show run interfaces
Traceback (most recent call last):
File "/usr/local/bin/sonic-cfggen", line 318, in
main()
File "/usr/local/bin/sonic-cfggen", line 302, in main
print(json.dumps(FormatConverter.to_serialized(data[args.var_json]), indent=4, cls=minigraph_encoder))
KeyError: 'INTERFACE'

Describe the results you expected:
No output, no error.

Output of show version:
SONiC Software Version: SONiC.HEAD.129-0c9040de
Distribution: Debian 9.11
Kernel: 4.9.0-9-2-amd64
Build commit: 0c9040d
Build date: Thu Nov 21 12:50:41 UTC 2019
Built by: johnar@jenkins-worker-4

Platform: x86_64-mlnx_msn2700-r0
HwSKU: Mellanox-SN2700
ASIC: mellanox

@mkovnir mkovnir changed the title "show run acl" returns traceback when no INTERFACE is present in configuration "show run interfaces" returns traceback when no INTERFACE is present in configuration Jan 16, 2020
jleveque pushed a commit that referenced this issue Mar 30, 2020
…ack when no ACL_RULE/INTERFACE is present. (#4226)

* Fix bugs - "show run acl/interfaces" returns traceback when no ACL_RULE/INTERFACE is present in configuration
- Change logic in main to take data only if the var_json appears in DB.
- Add unit testing for bug fix & fix comments

Signed-off-by: Noa Or <noaor@mellanox.com>
abdosi pushed a commit that referenced this issue Apr 15, 2020
…ack when no ACL_RULE/INTERFACE is present. (#4226)

* Fix bugs - "show run acl/interfaces" returns traceback when no ACL_RULE/INTERFACE is present in configuration
- Change logic in main to take data only if the var_json appears in DB.
- Add unit testing for bug fix & fix comments

Signed-off-by: Noa Or <noaor@mellanox.com>
tiantianlv pushed a commit to SONIC-DEV/sonic-buildimage that referenced this issue Apr 24, 2020
…terfaces" - traceback when no ACL_RULE/INTERFACE is present. (sonic-net#4226)

* Fix bugs - "show run acl/interfaces" returns traceback when no ACL_RULE/INTERFACE is present in configuration
- Change logic in main to take data only if the var_json appears in DB.
- Add unit testing for bug fix & fix comments

Signed-off-by: Noa Or <noaor@mellanox.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants