diff --git a/sonic-xcvrd/xcvrd/xcvrd_utilities/y_cable_helper.py b/sonic-xcvrd/xcvrd/xcvrd_utilities/y_cable_helper.py index aacc264b32b8..aba08a76921f 100644 --- a/sonic-xcvrd/xcvrd/xcvrd_utilities/y_cable_helper.py +++ b/sonic-xcvrd/xcvrd/xcvrd_utilities/y_cable_helper.py @@ -282,9 +282,9 @@ def check_identifier_presence_and_update_mux_table_entry(state_db, port_tbl, y_c else: # Convert list of tuples to a dictionary mux_table_dict = dict(fvs) - if "mux_cable" in mux_table_dict: - val = mux_table_dict.get("mux_cable", None) - if val == "true": + if "state" in mux_table_dict: + val = mux_table_dict.get("state", None) + if val in ["active", "auto"]: y_cable_asic_table = y_cable_tbl.get(asic_index, None) mux_asic_table = mux_tbl.get(asic_index, None) @@ -314,6 +314,9 @@ def check_identifier_presence_and_update_mux_table_entry(state_db, port_tbl, y_c logical_port_name, y_cable_tbl[asic_index]) post_port_mux_info_to_db(logical_port_name, mux_tbl[asic_index]) post_port_mux_static_info_to_db(logical_port_name, static_tbl[asic_index]) + else: + helper_logger.log_warning( + "Could not retreive active or auto value for state kvp for {}, inside MUX_CABLE table".format(logical_port_name)) def check_identifier_presence_and_delete_mux_table_entry(state_db, port_tbl, asic_index, logical_port_name, y_cable_presence, delete_change_event): @@ -373,7 +376,7 @@ def init_ports_status_for_y_cable(platform_sfp, platform_chassis, y_cable_presen for namespace in namespaces: asic_id = multi_asic.get_asic_index_from_namespace(namespace) config_db[asic_id] = daemon_base.db_connect("CONFIG_DB", namespace) - port_tbl[asic_id] = swsscommon.Table(config_db[asic_id], "PORT") + port_tbl[asic_id] = swsscommon.Table(config_db[asic_id], "MUX_CABLE") port_table_keys[asic_id] = port_tbl[asic_id].getKeys() # Init PORT_STATUS table if ports are on Y cable @@ -414,7 +417,7 @@ def change_ports_status_for_y_cable_change_event(port_dict, y_cable_presence, st for namespace in namespaces: asic_id = multi_asic.get_asic_index_from_namespace(namespace) config_db[asic_id] = daemon_base.db_connect("CONFIG_DB", namespace) - port_tbl[asic_id] = swsscommon.Table(config_db[asic_id], "PORT") + port_tbl[asic_id] = swsscommon.Table(config_db[asic_id], "MUX_CABLE") port_table_keys[asic_id] = port_tbl[asic_id].getKeys() # Init PORT_STATUS table if ports are on Y cable and an event is received @@ -518,9 +521,9 @@ def check_identifier_presence_and_update_mux_info_entry(state_db, mux_tbl, asic_ else: # Convert list of tuples to a dictionary mux_table_dict = dict(fvs) - if "mux_cable" in mux_table_dict: - val = mux_table_dict.get("mux_cable", None) - if val == "true": + if "state" in mux_table_dict: + val = mux_table_dict.get("state", None) + if val in ["active", "auto"]: if mux_tbl.get(asic_index, None) is not None: # fill in the newly found entry @@ -535,6 +538,9 @@ def check_identifier_presence_and_update_mux_info_entry(state_db, mux_tbl, asic_ mux_tbl[asic_id] = swsscommon.Table(state_db[asic_id], MUX_CABLE_INFO_TABLE) # fill the newly found entry post_port_mux_info_to_db(logical_port_name, mux_tbl[asic_index]) + else: + helper_logger.log_warning( + "Could not retreive active or auto value for state kvp for {}, inside MUX_CABLE table".format(logical_port_name)) def get_firmware_dict(physical_port, target, side, mux_info_dict):