|
64 | 64 | ('grpc.http2.max_pings_without_data', 0)
|
65 | 65 | ]
|
66 | 66 |
|
| 67 | +CONFIG_MUX_STATES = ["active", "standby", "auto", "manual", "detach"] |
| 68 | + |
67 | 69 | DEFAULT_PORT_IDS = [0, 1]
|
68 | 70 |
|
69 | 71 | SYSLOG_IDENTIFIER = "y_cable_helper"
|
@@ -297,7 +299,7 @@ def check_mux_cable_port_type(logical_port_name, port_tbl, asic_index):
|
297 | 299 | val = mux_table_dict.get("state", None)
|
298 | 300 | cable_type = mux_table_dict.get("cable_type", None)
|
299 | 301 |
|
300 |
| - if val in ["active", "standby", "auto", "manual"]: |
| 302 | + if val in CONFIG_MUX_STATES: |
301 | 303 | if cable_type == "active-active":
|
302 | 304 | helper_logger.log_debug("Y_CABLE_DEBUG:check_mux_cable_port_type returning True active-active port {}".format(logical_port_name))
|
303 | 305 | return (True , "active-active")
|
@@ -670,7 +672,7 @@ def check_identifier_presence_and_setup_channel(logical_port_name, port_tbl, hw_
|
670 | 672 | soc_ipv4 = soc_ipv4_full.split('/')[0]
|
671 | 673 | cable_type = mux_table_dict.get("cable_type", None)
|
672 | 674 |
|
673 |
| - if val in ["active", "standby", "auto", "manual"] and cable_type == "active-active": |
| 675 | + if val in CONFIG_MUX_STATES and cable_type == "active-active": |
674 | 676 |
|
675 | 677 | # import the module and load the port instance
|
676 | 678 | y_cable_presence[:] = [True]
|
@@ -1191,7 +1193,7 @@ def check_identifier_presence_and_update_mux_table_entry(state_db, port_tbl, y_c
|
1191 | 1193 |
|
1192 | 1194 | val = mux_table_dict.get("state", None)
|
1193 | 1195 |
|
1194 |
| - if val in ["active", "auto", "manual", "standby"]: |
| 1196 | + if val in CONFIG_MUX_STATES: |
1195 | 1197 |
|
1196 | 1198 | # import the module and load the port instance
|
1197 | 1199 | physical_port_list = logical_port_name_to_physical_port_list(
|
@@ -1631,7 +1633,7 @@ def check_identifier_presence_and_update_mux_info_entry(state_db, mux_tbl, asic_
|
1631 | 1633 | mux_table_dict = dict(fvs)
|
1632 | 1634 | if "state" in mux_table_dict:
|
1633 | 1635 | val = mux_table_dict.get("state", None)
|
1634 |
| - if val in ["active", "auto", "manual", "standby"]: |
| 1636 | + if val in CONFIG_MUX_STATES: |
1635 | 1637 |
|
1636 | 1638 | if mux_tbl.get(asic_index, None) is not None:
|
1637 | 1639 | # fill in the newly found entry
|
|
0 commit comments