def __initialize_sfp(self): sfputil_helper = SfpUtilHelper() port_config_file_path = device_info.get_path_to_port_config_file() sfputil_helper.read_porttab_mappings(port_config_file_path, 0) from .sfp import Sfp for index in range(0, NUM_SFP): sfp = Sfp(index, sfputil_helper.logical[index]) self._sfp_list.append(sfp) self.sfp_module_initialized = True
def get_name(self): """ Retrieves the name of the device Returns: string: The name of the device """ sfputil_helper = SfpUtilHelper() sfputil_helper.read_porttab_mappings( self.__get_path_to_port_config_file()) name = sfputil_helper.logical[self.index] or "Unknown" return name