sonic-utilities icon indicating copy to clipboard operation
sonic-utilities copied to clipboard

[config] Fix some issues in config.

Open LGH-12 opened this issue 3 years ago • 3 comments

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)

LGH-12 avatar Sep 30 '22 08:09 LGH-12

Please resolve conflicts and merge latest master code to trigger Semgrep.

maipbui avatar Jun 29 '23 15:06 maipbui

Please add unit test to cover this change.

maipbui avatar Jul 03 '23 13:07 maipbui

Please add unit test to cover this change.

Updated !

LGH-12 avatar Jul 07 '23 09:07 LGH-12