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

Some improvement for Mellanox sniffer CLI #345

Merged
merged 1 commit into from
Oct 16, 2018

Conversation

kevinwangsk
Copy link
Contributor

  • Hide Mellanox sniffer CLI on other platforms
  • Set enable/disable to be the argument of sniffer command rather
    than the sub-command

Signed-off-by: Kevin Wang kevinw@mellanox.com

- What I did
Make the CLI "config/show platform mlnx" just appear on Mellanox platform.
- How I did it
Use sonic_platform.get_sonic_version_info()['asic_type'] to identify the running platform.
- How to verify it
Should not see "config/show platform mlnx" CLI on the other platforms.
- Previous command output (if the output of a command-line utility has changed)

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

-->

* Hide Mellanox sniffer CLI on other platforms
* Set enable/disable to be the argument of sniffer command rather
than the sub-command

Signed-off-by: Kevin Wang <kevinw@mellanox.com>
@lguohan lguohan merged commit 09977fc into sonic-net:master Oct 16, 2018
@qiluo-msft
Copy link
Contributor

qiluo-msft commented Oct 18, 2018

This will break 'show interface status' or 'config' in vs. Please check.

root@346360b6760c:/# show interface status
Traceback (most recent call last):
  File "/usr/bin/show", line 9, in <module>
    load_entry_point('sonic-utilities==1.2', 'console_scripts', 'show')()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 484, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2714, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2332, in load
    return self.resolve()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2338, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python2.7/dist-packages/show/main.py", line 638, in <module>
    if (sonic_platform.get_sonic_version_info()['asic_type'] == 'mellanox'):
TypeError: 'NoneType' object has no attribute '__getitem__'

root@346360b6760c:/# config ?
Traceback (most recent call last):
  File "/usr/bin/config", line 9, in <module>
    load_entry_point('sonic-utilities==1.2', 'console_scripts', 'config')()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 484, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2714, in load_entry_point
    return ep.load()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2332, in load
    return self.resolve()
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 2338, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/usr/lib/python2.7/dist-packages/config/main.py", line 929, in <module>
    if (sonic_platform.get_sonic_version_info()['asic_type'] == 'mellanox'):
TypeError: 'NoneType' object has no attribute '__getitem__'

qiluo-msft added a commit that referenced this pull request Oct 18, 2018
qiluo-msft added a commit to qiluo-msft/sonic-utilities that referenced this pull request Oct 18, 2018
@qiluo-msft
Copy link
Contributor

The quick fix is reverting.
The root cause is missing /etc/sonic/sonic_version.yml in vs docker sonic-net/sonic-buildimage#2134

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.

5 participants