From 879d6303c0ad3c11e5db37c5ffc995dd59fb39c5 Mon Sep 17 00:00:00 2001 From: Tal Berlowitz <100570204+talber-nvidia@users.noreply.github.com> Date: Fri, 6 Jan 2023 01:57:42 +0200 Subject: [PATCH] Fix bug where transceiver info is missing after port breakout change (#329) --- sonic-xcvrd/tests/test_xcvrd.py | 3 +++ sonic-xcvrd/xcvrd/xcvrd.py | 1 + 2 files changed, 4 insertions(+) diff --git a/sonic-xcvrd/tests/test_xcvrd.py b/sonic-xcvrd/tests/test_xcvrd.py index 09cf0111abba..fd1a111f986e 100644 --- a/sonic-xcvrd/tests/test_xcvrd.py +++ b/sonic-xcvrd/tests/test_xcvrd.py @@ -790,6 +790,9 @@ def test_SfpStateUpdateTask_handle_port_change_event(self, mock_update_status_hw retry_eeprom_set = set() task = SfpStateUpdateTask(DEFAULT_NAMESPACE, port_mapping, retry_eeprom_set) task.xcvr_table_helper = XcvrTableHelper(DEFAULT_NAMESPACE) + task.xcvr_table_helper.get_status_tbl = mock_table_helper.get_status_tbl + task.xcvr_table_helper.get_intf_tbl = mock_table_helper.get_intf_tbl + task.xcvr_table_helper.get_dom_tbl = mock_table_helper.get_dom_tbl port_change_event = PortChangeEvent('Ethernet0', 1, 0, PortChangeEvent.PORT_ADD) wait_time = 5 while wait_time > 0: diff --git a/sonic-xcvrd/xcvrd/xcvrd.py b/sonic-xcvrd/xcvrd/xcvrd.py index d2bf44d732b7..17b71f24bf7b 100644 --- a/sonic-xcvrd/xcvrd/xcvrd.py +++ b/sonic-xcvrd/xcvrd/xcvrd.py @@ -2030,6 +2030,7 @@ def on_port_config_change(self , port_change_event): self.port_mapping.handle_port_change_event(port_change_event) elif port_change_event.event_type == port_mapping.PortChangeEvent.PORT_ADD: self.port_mapping.handle_port_change_event(port_change_event) + self.on_add_logical_port(port_change_event) def on_remove_logical_port(self, port_change_event): """Called when a logical port is removed from CONFIG_DB.