Skip to content

Commit 0c90e17

Browse files
committed
Fixes after PR #2
1 parent 3f3b9d4 commit 0c90e17

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

sonic-xcvrd/xcvrd/xcvrd.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -767,7 +767,7 @@ def get_media_settings_value(physical_port, key):
767767

768768

769769
def get_speed_and_lane_count(port, cfg_port_tbl):
770-
port_speed, lane_count = '0', '0'
770+
port_speed, lane_count = '0', 0
771771
found, port_info = cfg_port_tbl.get(port)
772772
port_info_dict = dict(port_info)
773773
if found and 'speed' in port_info_dict and 'lanes' in port_info_dict:
@@ -785,7 +785,7 @@ def get_lane_speed_key(physical_port, port_speed, lane_count):
785785
if is_cmis_api(api):
786786
appl_adv_dict = api.get_application_advertisement()
787787
app_id = get_cmis_application_desired(api, int(lane_count), int(port_speed))
788-
if app_id:
788+
if app_id and app_id in appl_adv_dict:
789789
host_electrical_interface_id = appl_adv_dict[app_id].get('host_electrical_interface_id')
790790
if host_electrical_interface_id:
791791
lane_speed_key = LANE_SPEED_KEY_PREFIX + host_electrical_interface_id.split()[0]
@@ -837,7 +837,7 @@ def get_media_settings_key(physical_port, transceiver_dict, port_speed, lane_cou
837837
media_key += '-' + '*'
838838

839839
lane_speed_key = get_lane_speed_key(physical_port, port_speed, lane_count)
840-
return [vendor_key, media_key, lane_speed_key]
840+
return (vendor_key, media_key, lane_speed_key)
841841

842842

843843
def get_media_val_str_from_dict(media_dict):
@@ -1592,7 +1592,7 @@ def task_worker(self):
15921592
continue
15931593

15941594
try:
1595-
self.log_notice("Starting CMIS state machine...")
1595+
self.log_debug("Starting CMIS state machine for port {}".format(lport))
15961596
# CMIS state transitions
15971597
if state == self.CMIS_STATE_INSERTED:
15981598
self.port_dict[lport]['appl'] = get_cmis_application_desired(api, host_lane_count, host_speed)

0 commit comments

Comments
 (0)