def test_udid2scsi(self): """Test udid_to_scsi_mapping.""" maps = self.dwrap.scsi_mappings # 2nd mapping has no client adapter lpar_id = maps[1].server_adapter.lpar_id # Default: ignore orphan self.assertIsNone( clstor.udid_to_scsi_mapping(self.dwrap, maps[1].backing_storage.udid, lpar_id)) # Don't ignore orphan self.assertEqual( maps[1], clstor.udid_to_scsi_mapping(self.dwrap, maps[1].backing_storage.udid, lpar_id, ignore_orphan=False)) # Doesn't work if the LPAR ID is wrong self.assertIsNone( clstor.udid_to_scsi_mapping(self.dwrap, maps[1].backing_storage.udid, 123, ignore_orphan=False)) # 4th mapping has client adapter but no backing storage self.assertIsNone(clstor.udid_to_scsi_mapping(self.dwrap, 'bogus', 22))
def set_slot_info(): vios_wraps = self.stg_ftsk.feed for vios_w in vios_wraps: scsi_map = pvm_c_stor.udid_to_scsi_mapping( vios_w, self._get_udid(), partition_id) if not scsi_map: continue slot_mgr.register_vscsi_mapping(scsi_map)
def set_slot_info(): vios_wraps = self.stg_ftsk.feed partition_id = vm.get_vm_id(self.adapter, self.vm_uuid) for vios_w in vios_wraps: scsi_map = pvm_c_stor.udid_to_scsi_mapping( vios_w, path, partition_id) if not scsi_map: continue slot_mgr.register_vscsi_mapping(scsi_map)