From 2433e9be7ce4a7bce738df1b5c40a8da4322cf82 Mon Sep 17 00:00:00 2001 From: vdahiya12 <67608553+vdahiya12@users.noreply.github.com> Date: Thu, 17 Aug 2023 13:35:50 -0700 Subject: [PATCH] [ycable] Curb log messages in active-active by changing verbosity level; fix missing namespaces in delete event handle (#391) * [ycabled][active-active] Correct the behavior when no active-active cable type Signed-off-by: vaibhav dahiya --- sonic-ycabled/tests/test_y_cable_helper.py | 301 ++++++++++++++++++ .../ycable/ycable_utilities/y_cable_helper.py | 43 +-- 2 files changed, 323 insertions(+), 21 deletions(-) diff --git a/sonic-ycabled/tests/test_y_cable_helper.py b/sonic-ycabled/tests/test_y_cable_helper.py index 04ac6f7b5..c5b449301 100644 --- a/sonic-ycabled/tests/test_y_cable_helper.py +++ b/sonic-ycabled/tests/test_y_cable_helper.py @@ -1624,6 +1624,7 @@ def test_check_identifier_presence_and_update_mux_table_entry_module_microsoft_y state_db, port_tbl, y_cable_tbl, static_tbl, mux_tbl, asic_index, logical_port_name, y_cable_presence) assert(rc == None) + @patch('ycable.ycable_utilities.y_cable_helper.logical_port_name_to_physical_port_list', MagicMock(return_value=[0])) @patch('ycable.ycable_utilities.y_cable_helper.y_cable_port_locks', MagicMock(return_value=[0])) def test_check_identifier_presence_and_delete_mux_table_entry(self): @@ -1660,6 +1661,8 @@ def test_check_identifier_presence_and_delete_mux_table_entry(self): rc = check_identifier_presence_and_delete_mux_table_entry( state_db, port_tbl, asic_index, logical_port_name, y_cable_presence, delete_change_event, y_cable_tbl, static_tbl, mux_tbl) assert(rc == None) + + @patch('ycable.ycable_utilities.y_cable_helper.y_cable_platform_chassis') @patch('ycable.ycable_utilities.y_cable_helper.y_cable_platform_sfputil') @@ -1781,6 +1784,107 @@ def mock_get_asic_id(mock_logical_port_name): assert(rc == None) + + @patch('ycable.ycable_utilities.y_cable_helper.logical_port_name_to_physical_port_list', MagicMock(return_value=[0])) + @patch('ycable.ycable_utilities.y_cable_helper.y_cable_port_locks', MagicMock(return_value=[0])) + @patch('ycable.ycable_utilities.y_cable_helper.check_mux_cable_port_type', MagicMock(return_value=(True,"active-active"))) + @patch('ycable.ycable_utilities.y_cable_helper.check_identifier_presence_and_setup_channel', MagicMock(return_value=(None))) + @patch('ycable.ycable_utilities.y_cable_helper.process_loopback_interface_and_get_read_side',MagicMock(return_value=0)) + @patch('swsscommon.swsscommon.Table') + def test_change_ports_status_for_y_cable_change_event_sfp_removed_with_false(self, mock_swsscommon_table): + + mock_logical_port_name = [""] + + def mock_get_asic_id(mock_logical_port_name): + return 0 + + y_cable_presence = [True] + logical_port_dict = {'Ethernet0': '0'} + state_db = {} + + mock_table = MagicMock() + mock_table.getKeys = MagicMock(return_value=['Ethernet0', 'Ethernet4']) + mock_table.get = MagicMock( + side_effect=[(True, (('index', 1), )), (True, (('index', 2), ))]) + mock_swsscommon_table.return_value = mock_table + + fvs = [('state', "auto"), ('read_side', 1)] + test_db = "TEST_DB" + port_tbl = {} + asic_index = 0 + status = True + port_tbl[asic_index] = swsscommon.Table( + test_db[asic_index], "PORT_INFO_TABLE") + port_tbl[asic_index].get.return_value = (status, fvs) + + port_table_keys, loopback_tbl, loopback_keys, hw_mux_cable_tbl, hw_mux_cable_tbl_peer, y_cable_tbl, static_tbl, mux_tbl, grpc_client, fwd_state_response_tbl = {}, {}, {}, {}, {}, {}, {}, {}, {}, {} + port_table_keys[0] = ['Ethernet0'] + + with patch('ycable.ycable_utilities.y_cable_helper.y_cable_platform_sfputil') as patched_util: + + patched_util.get_asic_id_for_logical_port.return_value = 0 + rc = change_ports_status_for_y_cable_change_event( + logical_port_dict, y_cable_presence, port_tbl, port_table_keys, loopback_tbl, loopback_keys, hw_mux_cable_tbl, hw_mux_cable_tbl_peer, y_cable_tbl, static_tbl, mux_tbl, grpc_client, fwd_state_response_tbl, state_db, stop_event=threading.Event()) + + assert(rc == None) + + + @patch('ycable.ycable_utilities.y_cable_helper.logical_port_name_to_physical_port_list', MagicMock(return_value=[0])) + @patch('ycable.ycable_utilities.y_cable_helper.y_cable_port_locks', MagicMock(return_value=[0])) + @patch('ycable.ycable_utilities.y_cable_helper.check_mux_cable_port_type', MagicMock(return_value=(True,"active-active"))) + @patch('ycable.ycable_utilities.y_cable_helper.check_identifier_presence_and_setup_channel', MagicMock(return_value=(None))) + @patch('ycable.ycable_utilities.y_cable_helper.process_loopback_interface_and_get_read_side',MagicMock(return_value=0)) + @patch('swsscommon.swsscommon.Table') + def test_change_ports_status_for_y_cable_change_event_sfp_removed_with_removal(self, mock_swsscommon_table): + + mock_logical_port_name = [""] + + def mock_get_asic_id(mock_logical_port_name): + return 0 + + y_cable_presence = [True] + logical_port_dict = {'Ethernet0': '0'} + state_db = {} + + mock_table = MagicMock() + mock_table.getKeys = MagicMock(return_value=['Ethernet0', 'Ethernet4']) + mock_table.get = MagicMock( + side_effect=[(True, (('index', 1), ('state', "auto"), ('read_side', 1))), (True, (('index', 2), ('state', "auto"), ('read_side', 1)))]) + mock_swsscommon_table.return_value = mock_table + + fvs = [('state', "auto"), ('read_side', 1)] + test_db = "TEST_DB" + port_tbl ,y_cable_tbl = {}, {} + asic_index = 0 + status = True + port_tbl[asic_index] = swsscommon.Table( + test_db[asic_index], "PORT_INFO_TABLE") + port_tbl[asic_index].get.return_value = (status, fvs) + y_cable_tbl[asic_index] = swsscommon.Table( + test_db[asic_index], "PORT_INFO_TABLE") + y_cable_tbl[asic_index].get.return_value = (status, fvs) + + port_table_keys, loopback_tbl, loopback_keys, hw_mux_cable_tbl, hw_mux_cable_tbl_peer, static_tbl, mux_tbl, grpc_client, fwd_state_response_tbl = {}, {}, {}, {}, {}, {}, {}, {}, {} + port_table_keys[0] = ['Ethernet0'] + + with patch('ycable.ycable_utilities.y_cable_helper.y_cable_platform_sfputil') as patched_util: + + patched_util.get_asic_id_for_logical_port.return_value = 0 + rc = change_ports_status_for_y_cable_change_event( + logical_port_dict, y_cable_presence, port_tbl, port_table_keys, loopback_tbl, loopback_keys, hw_mux_cable_tbl, hw_mux_cable_tbl_peer, y_cable_tbl, static_tbl, mux_tbl, grpc_client, fwd_state_response_tbl, state_db, stop_event=threading.Event()) + + assert(rc == None) + + + + + + + + + + + @patch('ycable.ycable_utilities.y_cable_helper.logical_port_name_to_physical_port_list', MagicMock(return_value=[0])) @patch('ycable.ycable_utilities.y_cable_helper.y_cable_port_locks', MagicMock(return_value=[0])) @patch('ycable.ycable_utilities.y_cable_helper.process_loopback_interface_and_get_read_side',MagicMock(return_value=0)) @@ -1888,6 +1992,43 @@ def test_check_identifier_presence_and_update_mux_info_entry(self): assert(rc == None) + + def test_check_identifier_presence_and_update_mux_info_entry_with_false(self): + asic_index = 0 + logical_port_name = "Ethernet0" + + state_db = {} + test_db = "TEST_DB" + status = False + mux_tbl = {} + y_cable_tbl = {} + static_tbl = {} + fvs = [('state', "auto"), ('read_side', 1)] + y_cable_tbl[asic_index] = swsscommon.Table( + test_db[asic_index], "Y_CABLE_TABLE") + y_cable_tbl[asic_index].get.return_value = (status, fvs) + static_tbl[asic_index] = swsscommon.Table( + test_db[asic_index], "STATIC_TABLE") + static_tbl[asic_index].get.return_value = (status, fvs) + + + mux_tbl[asic_index] = swsscommon.Table( + test_db[asic_index], MUX_CABLE_INFO_TABLE) + + with patch('ycable.ycable_utilities.y_cable_helper.y_cable_platform_sfputil') as patched_util: + + patched_util.logical.return_value = ['Ethernet0', 'Ethernet4'] + rc = check_identifier_presence_and_update_mux_info_entry( + state_db, mux_tbl, asic_index, logical_port_name, y_cable_tbl, static_tbl) + + assert(rc == None) + + + + + + + @patch('ycable.ycable_utilities.y_cable_helper.y_cable_port_instances') @patch('swsscommon.swsscommon.Table') def test_get_firmware_dict(self, port_instance, mock_swsscommon_table): @@ -2116,6 +2257,81 @@ def get_nic_temperature(self): assert(rc['mux_direction'] == 'self') assert(rc['internal_voltage'] == 0.5) + + @patch('ycable.ycable_utilities.y_cable_helper.y_cable_port_locks', MagicMock(return_value=[0])) + @patch('ycable.ycable_utilities.y_cable_helper.y_cable_platform_sfputil') + def test_get_muxcable_info_with_false(self, platform_sfputil): + physical_port = 20 + + logical_port_name = "Ethernet20" + swsscommon.Table.return_value.get.return_value = ( + False, {"read_side": "1"}) + platform_sfputil.get_asic_id_for_logical_port = 0 + asic_index = 0 + y_cable_tbl = {} + mux_tbl = {} + test_db = "TEST_DB" + status = False + fvs = [('state', "auto"), ('read_side', 1)] + y_cable_tbl[asic_index] = swsscommon.Table( + test_db[asic_index], "Y_CABLE_TABLE") + y_cable_tbl[asic_index].get.return_value = (status, fvs) + + with patch('ycable.ycable_utilities.y_cable_helper.y_cable_port_instances') as patched_util: + + class PortInstanceHelper(): + def __init__(self): + self.EEPROM_ERROR = -1 + self.TARGET_NIC = 1 + self.TARGET_TOR_A = 1 + self.TARGET_TOR_B = 1 + self.FIRMWARE_DOWNLOAD_STATUS_INPROGRESS = 1 + self.FIRMWARE_DOWNLOAD_STATUS_FAILED = 2 + self.download_firmware_status = 0 + self.MUX_TOGGLE_STATUS_INPROGRESS = 1 + self.MUX_TOGGLE_STATUS_FAILED = 2 + self.MUX_TOGGLE_STATUS_NOT_INITIATED_OR_FINISHED = 2 + self.mux_toggle_status = 0 + self.SWITCH_COUNT_MANUAL = "manual" + self.SWITCH_COUNT_AUTO = "auto" + + def get_active_linked_tor_side(self): + return 1 + + def get_mux_direction(self): + return 1 + + def get_switch_count_total(self, switch_count): + return 1 + + def get_eye_heights(self, tgt_tor): + return 500 + + def is_link_active(self, tgt_nic): + return True + + def get_local_temperature(self): + return 22.75 + + def get_local_voltage(self): + return 0.5 + + def get_nic_voltage(self): + return 2.7 + + def get_nic_temperature(self): + return 20 + + patched_util.get.return_value = PortInstanceHelper() + + with patch('ycable.ycable_utilities.y_cable_helper.y_cable_platform_sfputil') as patched_util: + patched_util.get_asic_id_for_logical_port.return_value = 0 + + rc = get_muxcable_info(physical_port, logical_port_name, mux_tbl, asic_index, y_cable_tbl) + + assert(rc == -1) + + @patch('ycable.ycable_utilities.y_cable_helper.y_cable_port_locks', MagicMock(return_value=[0])) @patch('ycable.ycable_utilities.y_cable_helper.y_cable_platform_sfputil') def test_get_muxcable_info_peer_side(self, platform_sfputil): @@ -6399,6 +6615,43 @@ def test_check_identifier_presence_and_setup_channel(self): assert(rc == None) + @patch('ycable.ycable_utilities.y_cable_helper.logical_port_name_to_physical_port_list', MagicMock(return_value=[0])) + def test_check_identifier_presence_and_setup_channel_with_false_status(self): + + status = False + fvs = [('state', "auto"), ('read_side', 1), ('cable_type','active-active'), ('soc_ipv4','192.168.0.1')] + + state_db = {} + test_db = "TEST_DB" + y_cable_tbl = {} + static_tbl = {} + mux_tbl = {} + hw_mux_cable_tbl = {} + hw_mux_cable_tbl_peer = {} + port_tbl = {} + read_side = 0 + asic_index = 0 + y_cable_presence = [True] + delete_change_event = [True] + swsscommon.Table.return_value.get.return_value = ( + False, {"config": "1"}) + + port_tbl[asic_index] = swsscommon.Table( + test_db[asic_index], "PORT_INFO_TABLE") + port_tbl[asic_index].get.return_value = (status, fvs) + hw_mux_cable_tbl[asic_index] = swsscommon.Table( + test_db[asic_index], "HW_TABLE1") + hw_mux_cable_tbl_peer[asic_index] = swsscommon.Table( + test_db[asic_index], "HW_TABLE2") + grpc_client , fwd_state_response_tbl = {}, {} + mux_tbl[asic_index] = swsscommon.Table( + test_db[asic_index], "MUX_INFO_TABLE") + + rc = check_identifier_presence_and_setup_channel("Ethernet0", port_tbl, hw_mux_cable_tbl, hw_mux_cable_tbl_peer, asic_index, read_side, mux_tbl, y_cable_presence, grpc_client, fwd_state_response_tbl) + + assert(rc == None) + + @patch('ycable.ycable_utilities.y_cable_helper.logical_port_name_to_physical_port_list', MagicMock(return_value=[0])) @patch('ycable.ycable_utilities.y_cable_helper.setup_grpc_channel_for_port', MagicMock(return_value=(None, None))) def test_check_identifier_presence_and_setup_channel_with_mock(self): @@ -6498,6 +6751,33 @@ def test_setup_grpc_channel_for_port(self): assert(stub == True) assert(channel != None) + @patch('proto_out.linkmgr_grpc_driver_pb2_grpc.DualToRActiveStub', MagicMock(return_value=True)) + def test_setup_grpc_channel_for_port_get_false(self): + + status = False + fvs = [('state', "auto"), ('read_side', 1), ('cable_type','active-standby'), ('soc_ipv4','192.168.0.1')] + grpc_client , fwd_state_response_tbl = {}, {} + asic_index = 0 + Table = MagicMock() + Table.get.return_value = (status, fvs) + #swsscommon.Table.return_value.get.return_value = ( + # True, { 'config', {'type': 'secure'}}) + swsscommon.Table.return_value.get.return_value = ( + False, {"config": "1"}) + test_db = "TEST_DB" + asic_index = 0 + grpc_client[asic_index] = swsscommon.Table( + test_db[asic_index], "PORT_INFO_TABLE") + with patch('ycable.ycable_utilities.y_cable_helper.y_cable_platform_sfputil') as patched_util: + + patched_util.get_asic_id_for_logical_port.return_value = 0 + (channel, stub) = setup_grpc_channel_for_port("Ethernet0", "192.168.0.1", asic_index, grpc_client, fwd_state_response_tbl, False) + + assert(stub == True) + assert(channel != None) + + + def test_connect_channel(self): with patch('grpc.channel_ready_future') as patched_util: @@ -7123,6 +7403,27 @@ def test_get_muxcable_info_for_active_active(self): assert(rc['mux_direction_probe_count'] == 'unknown') assert(rc['peer_mux_direction_probe_count'] == 'unknown') + def test_get_muxcable_info_for_active_active_with_false(self): + physical_port = 20 + + logical_port_name = "Ethernet20" + swsscommon.Table.return_value.get.return_value = ( + False, {"read_side": "1"}) + asic_index = 0 + y_cable_tbl = {} + mux_tbl = {} + test_db = "TEST_DB" + status = True + fvs = [('state', "auto"), ('read_side', 1)] + y_cable_tbl[asic_index] = swsscommon.Table( + test_db[asic_index], "Y_CABLE_TABLE") + y_cable_tbl[asic_index].get.return_value = (status, fvs) + + rc = get_muxcable_info_for_active_active(physical_port, logical_port_name, mux_tbl, asic_index, y_cable_tbl) + + assert(rc != None) + + @patch("grpc.aio.secure_channel") diff --git a/sonic-ycabled/ycable/ycable_utilities/y_cable_helper.py b/sonic-ycabled/ycable/ycable_utilities/y_cable_helper.py index cfd6cadc3..f0b16ebb1 100644 --- a/sonic-ycabled/ycable/ycable_utilities/y_cable_helper.py +++ b/sonic-ycabled/ycable/ycable_utilities/y_cable_helper.py @@ -296,7 +296,7 @@ def check_mux_cable_port_type(logical_port_name, port_tbl, asic_index): (status, fvs) = port_tbl[asic_index].get(logical_port_name) if status is False: - helper_logger.log_warning( + helper_logger.log_debug( "Could not retreive fieldvalue pairs for {}, inside config_db table {}".format(logical_port_name, port_tbl[asic_index].getTableName())) return (False, None) @@ -353,7 +353,7 @@ def retry_setup_grpc_channel_for_port(port, asic_index, port_tbl, grpc_client, f (status, fvs) = port_tbl[asic_index].get(port) if status is False: - helper_logger.log_warning( + helper_logger.log_debug( "Could not retreive fieldvalue pairs for {}, inside config_db table {}".format(port, port_tbl[asic_index].getTableName())) return False @@ -546,7 +546,7 @@ def setup_grpc_channel_for_port(port, soc_ip, asic_index, grpc_config, fwd_state (status, fvs) = grpc_config[asic_index].get("config") if status is False: - helper_logger.log_warning( + helper_logger.log_debug( "Could not retreive fieldvalue pairs for {}, inside config_db table kvp config for {} for setting up channel type".format(port, grpc_config[asic_index].getTableName())) else: grpc_config_dict = dict(fvs) @@ -558,7 +558,7 @@ def setup_grpc_channel_for_port(port, soc_ip, asic_index, grpc_config, fwd_state if type == "secure": (status, fvs) = grpc_config[asic_index].get("certs") if status is False: - helper_logger.log_warning( + helper_logger.log_debug( "Could not retreive fieldvalue pairs for {}, inside config_db table kvp certs for {} for setting up channel type".format(port, grpc_config[asic_index].getTableName())) #if type is secure, must have certs defined return (None, None) @@ -642,7 +642,7 @@ def check_identifier_presence_and_setup_channel(logical_port_name, port_tbl, hw_ (status, fvs) = port_tbl[asic_index].get(logical_port_name) if status is False: - helper_logger.log_warning( + helper_logger.log_debug( "Could not retreive fieldvalue pairs for {}, inside config_db table {}".format(logical_port_name, port_tbl[asic_index].getTableName())) return @@ -1155,7 +1155,7 @@ def check_identifier_presence_and_update_mux_table_entry(state_db, port_tbl, y_c global y_cable_port_locks (status, fvs) = port_tbl[asic_index].get(logical_port_name) if status is False: - helper_logger.log_warning( + helper_logger.log_debug( "Could not retreive fieldvalue pairs for {}, inside config_db table {}".format(logical_port_name, port_tbl[asic_index].getTableName())) return @@ -1297,7 +1297,7 @@ def check_identifier_presence_and_delete_mux_table_entry(state_db, port_tbl, asi (status, fvs) = port_tbl[asic_index].get(logical_port_name) if status is False: - helper_logger.log_warning( + helper_logger.log_debug( "Could not retreive fieldvalue pairs for {}, inside config_db table {}".format(logical_port_name, port_tbl[asic_index].getTableName())) return @@ -1310,7 +1310,7 @@ def check_identifier_presence_and_delete_mux_table_entry(state_db, port_tbl, asi #We dont delete the values here, rather just update the values in state DB (status, fvs) = y_cable_tbl[asic_index].get(logical_port_name) if status is False: - helper_logger.log_warning("Could not retreive fieldvalue pairs for {}, inside state_db table {} while deleting mux entry".format( + helper_logger.log_debug("Could not retreive fieldvalue pairs for {}, inside state_db table {} while deleting mux entry".format( logical_port_name, y_cable_tbl[asic_index].getTableName())) mux_port_dict = dict(fvs) read_side = mux_port_dict.get("read_side", None) @@ -1439,8 +1439,9 @@ def change_ports_status_for_y_cable_change_event(port_dict, y_cable_presence, po if y_cable_presence[0] is True and delete_change_event[0] is True: y_cable_presence[:] = [False] - state_db = {}, + state_db = {} yc_hw_mux_cable_table = {} + namespaces = multi_asic.get_front_end_namespaces() for namespace in namespaces: asic_id = multi_asic.get_asic_index_from_namespace( namespace) @@ -1510,7 +1511,7 @@ def check_identifier_presence_and_update_mux_info_entry(state_db, mux_tbl, asic_ (cable_status, cable_type) = check_mux_cable_port_type(logical_port_name, port_tbl, asic_index) if status is False: - helper_logger.log_info("Could not retreive fieldvalue pairs for {}, inside config_db table {}".format(logical_port_name, port_tbl[asic_index].getTableName())) + helper_logger.log_debug("Could not retreive fieldvalue pairs for {}, inside config_db table {}".format(logical_port_name, port_tbl[asic_index].getTableName())) return elif cable_status is True: @@ -1550,7 +1551,7 @@ def get_firmware_dict(physical_port, port_instance, target, side, mux_info_dict, (status, fvs) = mux_tbl[asic_index].get(logical_port_name) if status is False: - helper_logger.log_warning("Could not retreive fieldvalue pairs for {}, inside state_db table {}".format(logical_port_name, mux_tbl[asic_index].getTableName())) + helper_logger.log_debug("Could not retreive fieldvalue pairs for {}, inside state_db table {}".format(logical_port_name, mux_tbl[asic_index].getTableName())) mux_info_dict[("version_{}_active".format(side))] = "N/A" mux_info_dict[("version_{}_inactive".format(side))] = "N/A" mux_info_dict[("version_{}_next".format(side))] = "N/A" @@ -1690,7 +1691,7 @@ def get_muxcable_info_for_active_active(physical_port, port, mux_tbl, asic_index (status, fvs) = y_cable_tbl[asic_index].get(port) if status is False: - helper_logger.log_warning("Could not retreive fieldvalue pairs for {}, inside state_db table {}".format(logical_port_name, y_cable_tbl[asic_index].getTableName())) + helper_logger.log_debug("Could not retreive fieldvalue pairs for {}, inside state_db table {}".format(logical_port_name, y_cable_tbl[asic_index].getTableName())) return -1 mux_port_dict = dict(fvs) @@ -1825,7 +1826,7 @@ def get_muxcable_info(physical_port, logical_port_name, mux_tbl, asic_index, y_c (status, fvs) = y_cable_tbl[asic_index].get(logical_port_name) if status is False: - helper_logger.log_warning("Could not retreive fieldvalue pairs for {}, inside state_db table {}".format(logical_port_name, y_cable_tbl[asic_index].getTableName())) + helper_logger.log_debug("Could not retreive fieldvalue pairs for {}, inside state_db table {}".format(logical_port_name, y_cable_tbl[asic_index].getTableName())) return -1 mux_port_dict = dict(fvs) @@ -2073,7 +2074,7 @@ def get_muxcable_static_info(physical_port, logical_port_name, y_cable_tbl): (status, fvs) = y_cable_tbl[asic_index].get(logical_port_name) if status is False: - helper_logger.log_warning("Could not retreive fieldvalue pairs for {}, inside state_db table {}".format( + helper_logger.log_debug("Could not retreive fieldvalue pairs for {}, inside state_db table {}".format( logical_port_name, y_cable_tbl[asic_index].getTableName())) return -1 @@ -2178,7 +2179,7 @@ def post_port_mux_info_to_db(logical_port_name, mux_tbl, asic_index, y_cable_tbl if not y_cable_wrapper_get_presence(physical_port) or cable_type == 'pseudo-cable': mux_info_dict = get_muxcable_info_without_presence() elif cable_type == 'active-active': - helper_logger.log_warning("Error: trying to post mux info without presence of port {}".format(logical_port_name)) + helper_logger.log_debug("Error: trying to post mux info without presence of port {}".format(logical_port_name)) mux_info_dict = get_muxcable_info_for_active_active(physical_port, logical_port_name, mux_tbl, asic_index, y_cable_tbl) if mux_info_dict is not None and mux_info_dict != -1: fvs = swsscommon.FieldValuePairs( @@ -3260,7 +3261,7 @@ def handle_show_hwmode_state_cmd_arg_tbl_notification(fvp, port_tbl, xcvrd_show_ (status, fv) = hw_mux_cable_tbl[asic_index].get(port) if status is False: - helper_logger.log_warning("Could not retreive fieldvalue pairs for {}, inside state_db table while responding to cli cmd show mux status {}".format( + helper_logger.log_debug("Could not retreive fieldvalue pairs for {}, inside state_db table while responding to cli cmd show mux status {}".format( port, hw_mux_cable_tbl[asic_index].getTableName())) set_result_and_delete_port('state', 'unknown', xcvrd_show_hwmode_dir_cmd_sts_tbl[asic_index], xcvrd_show_hwmode_dir_rsp_tbl[asic_index], port) return -1 @@ -3392,7 +3393,7 @@ def handle_fwd_state_command_grpc_notification(fvp_m, hw_mux_cable_tbl, fwd_stat helper_logger.log_debug("Y_CABLE_DEBUG:processing the notification fwd_state port {}".format(port)) (status, fv) = hw_mux_cable_tbl[asic_index].get(port) if status is False: - helper_logger.log_warning("Could not retreive fieldvalue pairs for {}, inside state_db table {}".format( + helper_logger.log_debug("Could not retreive fieldvalue pairs for {}, inside state_db table {}".format( port, hw_mux_cable_tbl[asic_index].getTableName())) return False mux_port_dict = dict(fv) @@ -3464,7 +3465,7 @@ def handle_hw_mux_cable_table_grpc_notification(fvp, hw_mux_cable_tbl, asic_inde (status, fvs) = hw_mux_cable_tbl[asic_index].get(port) if status is False: - helper_logger.log_warning("Could not retreive fieldvalue pairs for {}, inside state_db table {}".format( + helper_logger.log_debug("Could not retreive fieldvalue pairs for {}, inside state_db table {}".format( port, hw_mux_cable_tbl[asic_index].getTableName())) return helper_logger.log_debug("Y_CABLE_DEBUG processing the notification mux hw state port {}".format(port)) @@ -3554,7 +3555,7 @@ def handle_ycable_active_standby_probe_notification(cable_type, fvp_dict, appl_d (status, fv) = hw_mux_cable_tbl[asic_index].get(port_m) if status is False: - helper_logger.log_warning("Could not retreive fieldvalue pairs for {}, inside state_db table {}".format( + helper_logger.log_debug("Could not retreive fieldvalue pairs for {}, inside state_db table {}".format( port_m, hw_mux_cable_tbl[asic_index].getTableName())) return False @@ -3678,7 +3679,7 @@ def task_worker(self): requested_status = new_status (status, fvs) = self.table_helper.get_hw_mux_cable_tbl()[asic_index].get(port) if status is False: - helper_logger.log_warning("Could not retreive fieldvalue pairs for {}, inside state_db table {}".format( + helper_logger.log_debug("Could not retreive fieldvalue pairs for {}, inside state_db table {}".format( port, self.table_helper.get_hw_mux_cable_tbl()[asic_index].getTableName())) continue mux_port_dict = dict(fvs) @@ -4084,7 +4085,7 @@ async def task_worker(self): asic_index = y_cable_platform_sfputil.get_asic_id_for_logical_port(logical_port_name) (status, fvs) = self.table_helper.get_port_tbl()[asic_index].get(logical_port_name) if status is False: - helper_logger.log_warning( + helper_logger.log_debug( "Could not retreive fieldvalue pairs for {}, inside config_db table {}".format(logical_port_name, self.table_helper.get_port_tbl()[asic_index].getTableName())) continue