def _generate_controlpath_id(gpu): driver_cpid = driver_controlpath_id.DriverControlPathID() # NOTE: GPUs (either pGPU or vGPU), they all report "PCI" as # their cpid_type, while attach_handle_type of them are different. driver_cpid.cpid_type = "PCI" driver_cpid.cpid_info = utils.pci_str_to_json(gpu["devices"]) return driver_cpid
def get_fake_driver_controlpath_objs(): controlpath_list = get_fake_driver_controlpath_as_dict() obj_controlpaths = [] for controlpath in controlpath_list: obj_driver_controlpath = driver_controlpath_id.DriverControlPathID() for field in controlpath.keys(): obj_driver_controlpath[field] = controlpath[field] obj_controlpaths.append(obj_driver_controlpath) return obj_controlpaths
def _generate_controlpath_id(self, pci): driver_cpid = driver_controlpath_id.DriverControlPathID() driver_cpid.cpid_type = "PCI" driver_cpid.cpid_info = pci["slot_json"] return driver_cpid
def _generate_controlpath_id(nic): driver_cpid = driver_controlpath_id.DriverControlPathID() driver_cpid.cpid_type = "PCI" driver_cpid.cpid_info = utils.pci_str_to_json(nic["device"]) return driver_cpid
def _generate_controlpath_id(fpga): driver_cpid = driver_controlpath_id.DriverControlPathID() driver_cpid.cpid_type = "pci" driver_cpid.cpid_info = fpga["devices"] return driver_cpid
def _generate_controlpath_id(gpu): driver_cpid = driver_controlpath_id.DriverControlPathID() driver_cpid.cpid_type = "PCI" driver_cpid.cpid_info = gpu["devices"] return driver_cpid