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 interface status, show platform summary and other cmds are broken #403

Closed
nikos-github opened this issue Dec 5, 2018 · 3 comments
Closed
Labels

Comments

@nikos-github
Copy link
Contributor

The #298 commit is breaking show commands for any port_config.ini that doesn't have an alias in it.

Alias is optional in sonic.

This is a blocker since platform/OS stability is compromised and identification as well as status for deployment is not possible.

show interface status error:

root@sonic:/# show interface status
Traceback (most recent call last):
File "/usr/bin/show", line 9, in
load_entry_point('sonic-utilities==1.2', 'console_scripts', 'show')()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 561, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2631, in load_entry_point
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2291, in load
return self.resolve()
File "/usr/lib/python2.7/dist-packages/pkg_resources/init.py", line 2297, in resolve
module = import(self.module_name, fromlist=['name'], level=0)
File "/usr/lib/python2.7/dist-packages/show/main.py", line 199, in
iface_alias_converter = InterfaceAliasConverter()
File "/usr/lib/python2.7/dist-packages/show/main.py", line 64, in init
self.port_dict[port_name]['alias']):
KeyError: 'alias'

show platform summary syslog error:
Dec 05 05:08:31 spine-1 aos[5216]: iface_alias_converter = InterfaceAliasConverter()
Dec 05 05:08:31 spine-1 aos[5216]: File "/usr/lib/python2.7/dist-packages/show/main.py", line 64, in init
Dec 05 05:08:31 spine-1 aos[5216]: self.port_dict[port_name]['alias']):
Dec 05 05:08:31 spine-1 aos[5216]: KeyError: 'alias'

@jleveque
Copy link
Contributor

jleveque commented Dec 5, 2018

@paavaanan, @padmanarayana: Please add logic to check for the existence of the "alias" field before all attempts to access it in order to prevent this crash.

Per our spec, https://github.com/Azure/SONiC/wiki/Configuration, the 'alias' field is optional in ConfigDB. Therefore, we must gracefully handle the case where it doesn't exist.

@nikos-github
Copy link
Contributor Author

Fixed by #405. Fix to verified once we have our new internal image.

@jleveque
Copy link
Contributor

@nikos-github: FYI, sonic-buildimage submodule update containing #405 in PR here: sonic-net/sonic-buildimage#2376

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

No branches or pull requests

2 participants