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

[storm_control] CLI show error when trying to show the configuration with the specified interface #2729

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

Conversation

sean-lang
Copy link

What I did

storm_contro CLI show error when trying to show the configuration with the specified interface

admin@sonic:~$ show storm-control interface Ethernet0
Traceback (most recent call last):
  File "/usr/local/bin/show", line 8, in <module>
    sys.exit(cli())
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.9/dist-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
TypeError: interface() missing 2 required positional arguments: 'namespace' and 'display' 

The interface() function of the show command is missing 2 required positional arguments: 'namespace' and 'display'.

How I did it

Added a default value for the arguments: 'namespace' and 'display

How to verify it

The CLI can display the storm_control setting of a given interface.

admin@sonic:~$ config interface storm-control add Ethernet0  broadcast 1000
admin@sonic:~$ show storm-control interface Ethernet0
+------------------+--------------+---------------+
| Interface Name   | Storm Type   |   Rate (kbps) |
+==================+==============+===============+
| Ethernet0        | broadcast    |          1000 |
+------------------+--------------+---------------+

admin@sonic:~$ config interface storm-control del Ethernet0 broadcast
admin@sonic:~$ show storm-control interface Ethernet0
admin@sonic:~$

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)

…with the specified interface

What I did:
The interface() function of the show command is missing 2 required positional arguments: 'namespace' and 'display'.

How I fixed it:
Added a default value for the arguments: 'namespace' and 'display

How to verify it:
The CLI can display the storm_control setting of a given interface.
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

Successfully merging this pull request may close these issues.

1 participant