def setUp(self):
super(TestWindowsDriver, self).setUp()
self.flags(
- windows_iscsi_lun_path='D:\iSCSIVirtualDisks',
+ windows_iscsi_lun_path='C:\iSCSIVirtualDisks',
)
self._volume_data = None
self._volume_data_2 = None
' while ensuring export'), exc)
#Get the disk to add
vol_name = volume['name']
- wt_disk = self._conn_wmi.WT_Disk(Description=vol_name)[0]
+ q = self._conn_wmi.WT_Disk(Description=vol_name)
+ if not len(q):
+ LOG.debug(_('Disk not found: %s'), vol_name)
+ return None
+ wt_disk = q[0]
wt_host = self._conn_wmi.WT_Host(HostName=target_name)[0]
wt_host.AddWTDisk(wt_disk.WTD)