-
Notifications
You must be signed in to change notification settings - Fork 650
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
[config] support for configuring muxcable to manual mode of operation #1642
Conversation
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
This pull request introduces 2 alerts when merging 4f943f9 into 25e17de - view on LGTM.com new alerts:
|
config/muxcable.py
Outdated
@@ -74,7 +74,8 @@ def lookup_statedb_and_update_configdb(per_npu_statedb, config_db, port, state_c | |||
|
|||
state = get_value_for_key_in_dict(muxcable_statedb_dict, port, "state", "MUX_CABLE_TABLE") | |||
if state_cfg_val is not configdb_state: | |||
config_db.set_entry("MUX_CABLE", port, {"state": state_cfg_val}) | |||
config_db.set_entry("MUX_CABLE", port, {"state": "active", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we can fix the lgtm by deleting the ipv4_value
and ip64_value
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
also, we are setting the entry to active
instead of state_cfg_val
.
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
config/muxcable.py
Outdated
port_status_dict[port] = 'OK' | ||
else: | ||
if str(state_cfg_val) == 'active' and str(state) != 'active': | ||
config_db.set_entry("MUX_CABLE", port, {"state": state_cfg_val, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the config_db.set_entry
should be outside the if statement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
…sonic-net#1642) What I did This PR adds support for an option to configure muxcable mode to a manual mode. The manual mode is in addition to auto/active mode. The new output would look like this in case an active flag is passed to the command line admin@sonic:~$ sudo config muxcable mode manual Ethernet0 admin@sonic:~$ sudo config muxcable mode manual all added an option to set muxcable mode to manual mode, in addition to existing auto/active modes. How I did it added the changes in config/muxcable.py and added testcases How to verify it Ran the unit tests Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
…#1642) What I did This PR adds support for an option to configure muxcable mode to a manual mode. The manual mode is in addition to auto/active mode. The new output would look like this in case an active flag is passed to the command line admin@sonic:~$ sudo config muxcable mode manual Ethernet0 admin@sonic:~$ sudo config muxcable mode manual all added an option to set muxcable mode to manual mode, in addition to existing auto/active modes. How I did it added the changes in config/muxcable.py and added testcases How to verify it Ran the unit tests Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
…sonic-net#1642) What I did This PR adds support for an option to configure muxcable mode to a manual mode. The manual mode is in addition to auto/active mode. The new output would look like this in case an active flag is passed to the command line admin@sonic:~$ sudo config muxcable mode manual Ethernet0 admin@sonic:~$ sudo config muxcable mode manual all added an option to set muxcable mode to manual mode, in addition to existing auto/active modes. How I did it added the changes in config/muxcable.py and added testcases How to verify it Ran the unit tests Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
Signed-off-by: vaibhav-dahiya vdahiya@microsoft.com
What I did
This PR adds support for an option to configure muxcable mode to a
manual
mode. The manual mode is in additionto
auto\active
mode.The new output would look like this in case an active flag is passed to the command line
admin@sonic:~$ sudo config muxcable mode manual Ethernet0
admin@sonic:~$ sudo config muxcable mode manual all
added an option to set muxcable mode to manual mode, in addition to existing auto/active modes.
How I did it
added the changes in config/muxcable.py and added testcases
How to verify it
Ran the 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)