Skip to content

Commit

Permalink
Updated CMIS module verification with the new method is_cmis_api()
Browse files Browse the repository at this point in the history
  • Loading branch information
tshalvi committed Nov 6, 2023
1 parent 0690bf5 commit f6ec4f3
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions sonic-xcvrd/xcvrd/xcvrd_utilities/media_settings_parser.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ def get_media_settings_key(physical_port, transceiver_dict, port_speed, lane_cou
media_compliance_dict = {}

try:
if xcvrd._wrapper_get_sfp_type(physical_port) == 'QSFP_DD':
sfp = xcvrd.platform_chassis.get_sfp(physical_port)
api = sfp.get_xcvr_api()
if xcvrd.is_cmis_api(api):
media_compliance_code = media_compliance_dict_str
else:
media_compliance_dict = ast.literal_eval(media_compliance_dict_str)
Expand All @@ -88,7 +90,9 @@ def get_media_settings_key(physical_port, transceiver_dict, port_speed, lane_cou
media_key += media_type
if len(media_compliance_code) != 0:
media_key += '-' + media_compliance_code
if xcvrd._wrapper_get_sfp_type(physical_port) == 'QSFP_DD':
sfp = xcvrd.platform_chassis.get_sfp(physical_port)
api = sfp.get_xcvr_api()
if xcvrd.is_cmis_api(api):
if media_compliance_code == "passive_copper_media_interface":
if media_len != 0:
media_key += '-' + str(media_len) + 'M'
Expand Down

0 comments on commit f6ec4f3

Please sign in to comment.