def __init__(self): PsuBase.__init__(self) global pddf_obj global plugin_data with open(os.path.join(os.path.dirname(os.path.realpath(__file__)) + '/../pddf/pd-plugin.json')) as pd: plugin_data = json.load(pd) pddf_obj = pddfparse.PddfParse() self.platform = pddf_obj.get_platform()
def __init__(self): global pddf_obj global plugin_data with open(os.path.join(os.path.dirname(os.path.realpath(__file__)) + '/../pddf/pd-plugin.json')) as pd: plugin_data = json.load(pd) pddf_obj = pddfparse.PddfParse() self.platform = pddf_obj.get_platform() self.num_thermals = self.platform['num_temps'] self.info = []
def __init__(self, name, path, cpld_root, ro): global pddf_obj global plugin_data with open( os.path.join( os.path.dirname(os.path.realpath(__file__)) + '/../pddf/pd-plugin.json')) as pd: plugin_data = json.load(pd) pddf_obj = pddfparse.PddfParse() # system EEPROM always has device name EEPROM1 self.eeprom_path = pddf_obj.get_path("EEPROM1", "eeprom") super(board, self).__init__(self.eeprom_path, 0, '', True)
def __init__(self): FanBase.__init__(self) global pddf_obj global plugin_data with open( os.path.join( os.path.dirname(os.path.realpath(__file__)) + '/../pddf/pd-plugin.json')) as pd: plugin_data = json.load(pd) pddf_obj = pddfparse.PddfParse() self.platform = pddf_obj.get_platform() self.num_fans = (self.platform['num_fantrays'] * self.platform['num_fans_pertray'])
def __init__(self, pddf_data=None, pddf_plugin_data=None): ChassisBase.__init__(self) self.pddf_obj = pddf_data if pddf_data else None self.plugin_data = pddf_plugin_data if pddf_plugin_data else None if not self.pddf_obj or not self.plugin_data: try: import pddfparse import json self.pddf_obj = pddfparse.PddfParse() with open( '/usr/share/sonic/platform/pddf/pd-plugin.json') as pd: self.plugin_data = json.load(pd) except Exception as e: raise Exception("Error: Unable to load PDDF JSON data - %s" % str(e)) self.platform_inventory = self.pddf_obj.get_platform() # Initialize EEPROM self.sys_eeprom = Eeprom(self.pddf_obj, self.plugin_data) # FANs for i in range(self.platform_inventory['num_fantrays']): for j in range(self.platform_inventory['num_fans_pertray']): fan = Fan(i, j, self.pddf_obj, self.plugin_data) self._fan_list.append(fan) # PSUs for i in range(self.platform_inventory['num_psus']): psu = Psu(i, self.pddf_obj, self.plugin_data) self._psu_list.append(psu) # OPTICs for index in range(self.platform_inventory['num_ports']): sfp = Sfp(index, self.pddf_obj, self.plugin_data) self._sfp_list.append(sfp) # THERMALs for i in range(self.platform_inventory['num_temps']): thermal = Thermal(i, self.pddf_obj, self.plugin_data) self._thermal_list.append(thermal) # SYSTEM LED Test Cases """
def __init__(self): SfpUtilBase.__init__(self) global pddf_obj global plugin_data with open( os.path.join( os.path.dirname(os.path.realpath(__file__)) + '/../pddf/pd-plugin.json')) as pd: plugin_data = json.load(pd) pddf_obj = pddfparse.PddfParse() self.platform = pddf_obj.get_platform() self._port_start = 0 self._port_end = self.get_num_ports() for port_num in range(self._port_start, self._port_end): device = "PORT" + "%d" % (port_num + 1) port_eeprom_path = pddf_obj.get_path(device, "eeprom") self._port_to_eeprom_mapping[port_num] = port_eeprom_path port_type = pddf_obj.get_device_type(device) self._port_to_type_mapping[port_num] = port_type self.populate_port_type(port_num)
def __init__(self): global pddf_obj pddf_obj = pddfparse.PddfParse() self.path = "pddf/devices/led" self.cur_state_path = "pddf/devices/led/cur_state"
PLATFORM_KEY = 'DEVICE_METADATA.localhost.platform' PROJECT_NAME = 'PDDF' version = '1.1' verbose = False DEBUG = False args = [] ALL_DEVICE = {} FORCE = 0 kos = [] perm_kos = [] devs = [] # Instantiate the class pddf_obj try: pddf_obj = pddfparse.PddfParse() except Exception as e: print("%s" % str(e)) sys.exit() if DEBUG == True: print(sys.argv[0]) print('ARGV :', sys.argv[1:]) def main(): global DEBUG global args global FORCE global kos