sonic-utilities
sonic-utilities copied to clipboard
[config] Fix some issues in config.
Signed-off-by: LTeng [email protected]
What I did
Fix #2415 1、At config/config_mgmt.py:648, there is "Exce" which looks like it should be "Exception". 2、Cmd "config mirror_session erspan add": gre_type is not required. validate_gre_type raise " AttributeError: 'NoneType' object has no attribute 'lower' " if gre_type is not provided. 3、Cmd "config interface cable_length": It is actually "config interface cable-length" at running time and caused by click 7.0 . And It is inconsistent with Command-Reference. 4、Cmd "config route del": In "if not tuple(key.split("|")) in keys and not prefix_tuple in keys", these two look the same. 5、Cmd "config sflow polling-interval": echo error but no return.
How I did it
1、Replace "Exce" with "Exception". 2、Add check: value is not None. 3、assign the name explicitly.Modified comments of priority-group for the same reason. 4、Remove one of them. 5、Replace "click.echo" with "ctx.fail".
How to verify it
Added unit tests.
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)
Please resolve conflicts and merge latest master code to trigger Semgrep.
Please add unit test to cover this change.
Please add unit test to cover this change.
Updated !