Skip to content

Commit

Permalink
[config][muxcable] fix minor config DB logic issue (#2210)
Browse files Browse the repository at this point in the history
Signed-off-by: vaibhav-dahiya vdahiya@microsoft.com
For active-standby type cable there will not be any soc_ipv4 entry in the "MUX_CABLE" table, hence when updating the config DB entry with update
for
sudo config mux mode <state> <port>
we should just check the cable_type and update the table entry
if no soc_ipv4 the value written in none in that case

What I did
How I did it
How to verify it
Unit-tests cover the change

Signed-off-by: vaibhav-dahiya <vdahiya@microsoft.com>
  • Loading branch information
vdahiya12 authored and yxieca committed Jun 15, 2022
1 parent 0fc6f47 commit 0e31790
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/muxcable.py
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ def lookup_statedb_and_update_configdb(db, per_npu_statedb, config_db, port, sta
if str(state_cfg_val) == str(configdb_state):
port_status_dict[port_name] = 'OK'
else:
if cable_type is not None and soc_ipv4_value is not None:
if cable_type is not None or soc_ipv4_value is not None:
config_db.set_entry("MUX_CABLE", port, {"state": state_cfg_val,
"server_ipv4": ipv4_value,
"server_ipv6": ipv6_value,
Expand Down

0 comments on commit 0e31790

Please sign in to comment.