diff --git a/sonic_platform_base/sonic_xcvr/api/public/c_cmis.py b/sonic_platform_base/sonic_xcvr/api/public/c_cmis.py index babbfd7cf..1e60458eb 100644 --- a/sonic_platform_base/sonic_xcvr/api/public/c_cmis.py +++ b/sonic_platform_base/sonic_xcvr/api/public/c_cmis.py @@ -3,13 +3,10 @@ Implementation of XcvrApi that corresponds to C-CMIS """ -from sonic_py_common import logger from ...fields import consts from .cmis import CmisApi, CMIS_VDM_KEY_TO_DB_PREFIX_KEY_MAP, CMIS_XCVR_INFO_DEFAULT_DICT import time import copy -BYTELENGTH = 8 -SYSLOG_IDENTIFIER = "CCmisApi" C_CMIS_DELTA_VDM_KEY_TO_DB_PREFIX_KEY_MAP = { 'Modulator Bias X/I [%]' : 'biasxi', @@ -43,9 +40,6 @@ 8: 'lowwarning_flag' } - -helper_logger = logger.Logger(SYSLOG_IDENTIFIER) - C_CMIS_XCVR_INFO_DEFAULT_DICT = copy.deepcopy(CMIS_XCVR_INFO_DEFAULT_DICT) C_CMIS_XCVR_INFO_DEFAULT_DICT.update({ "supported_max_tx_power": "N/A", @@ -62,35 +56,6 @@ def _get_vdm_key_to_db_prefix_map(self): combined_map = {**CMIS_VDM_KEY_TO_DB_PREFIX_KEY_MAP, **C_CMIS_DELTA_VDM_KEY_TO_DB_PREFIX_KEY_MAP} return combined_map - def _update_dict_if_vdm_key_exists(self, dict_to_be_updated, new_key, vdm_dict_key, vdm_subtype_index, lane=1): - ''' - This function updates the dictionary with the VDM value if the vdm_dict_key exists. - @param dict_to_be_updated: the dictionary to be updated. - @param new_key: the key to be added in dict_to_be_updated. - @param vdm_dict_key: lookup key in the VDM dictionary. - @param vdm_subtype_index: the index of the VDM subtype in the VDM page. - 0 refers to the real time value - 1 refers to the high alarm threshold - 2 refers to the low alarm threshold - 3 refers to the high warning threshold - 4 refers to the low warning threshold - 5 refers to the high alarm flag - 6 refers to the low alarm flag - 7 refers to the high warning flag - 8 refers to the low warning flag - @param lane: the lane number. Default is 1. - - @return: True if the key exists in the VDM dictionary, False if not. - ''' - try: - dict_to_be_updated[new_key] = self.vdm_dict[vdm_dict_key][lane][vdm_subtype_index] - except KeyError: - dict_to_be_updated[new_key] = 'N/A' - helper_logger.log_debug('key {} not present in VDM'.format(new_key)) - return False - - return True - def get_freq_grid(self): ''' This function returns the configured frequency grid. Unit in GHz