def bldStorDisplayList(self): " build displayable storage list" # only repopulate esxlocation if we need to if userchoices.getResetEsxLocation(): self.storList = \ storage_utils.getStorageList(devices.DiskSet(), vmfsSupport=(self.partMode=="basic"), esxAndCos=(self.partMode=="basic")) # build storage list storListText = [] storEnumStr = "%2d) %-51s %3s %4s %11s" storEnumPath = " %s" storListText.append(diskHeaderText) for num, storLine in enumerate(self.storList): deviceModel, lunid, disksize, entry, pathString, targetid = storLine storListText.append( storEnumStr % (num + 1, deviceModel, lunid, targetid, disksize)) for path in pathString: tempEnumPath = storEnumPath % path while tempEnumPath: storListText.append(tempEnumPath[:80]) tempEnumPath = tempEnumPath[80:] self.setScrollEnv(storListText, SCROLL_LIMIT) self.setSubstepEnv({'next': self.scrollDisplay})
def bldStorDisplayList(self): " build displayable storage list" # only repopulate esxlocation if we need to if userchoices.getResetEsxLocation(): self.storList = \ storage_utils.getStorageList(devices.DiskSet(), vmfsSupport=(self.partMode=="basic"), esxAndCos=(self.partMode=="basic")) # build storage list storListText = [] storEnumStr = "%2d) %-51s %3s %4s %11s" storEnumPath = " %s" storListText.append(diskHeaderText) for num, storLine in enumerate(self.storList): deviceModel, lunid, disksize, entry, pathString, targetid = storLine storListText.append(storEnumStr % (num+1, deviceModel, lunid, targetid, disksize) ) for path in pathString: tempEnumPath = storEnumPath % path while tempEnumPath: storListText.append(tempEnumPath[:80]) tempEnumPath = tempEnumPath[80:] self.setScrollEnv(storListText, SCROLL_LIMIT) self.setSubstepEnv( {'next': self.scrollDisplay} )
def __init__(self, partMode="basic"): super(EsxLocationWindow, self).__init__() self.storList = \ storage_utils.getStorageList(devices.DiskSet(), vmfsSupport=(partMode=="basic"), esxAndCos=(partMode=="basic")) self.partMode = partMode # basic or advanced self.driveName = None self.start = self.bldStorDisplayList self.substep = self.start self.scrollable = None
def __init__(self, parent, skipEsxDevice=True): """Initialize using parent's environment. Generates self.storDevList - list of allowable storage devices. """ super(ChooseDataStoreDevice, self).__init__() self.substep = self.start = self.showDevices self.scrollable = None self.parent = parent self.selectedDevice = None if skipEsxDevice: allowedDiskSet = pruneDiskSet(devices.DiskSet(), [self.parent.esxDeviceName]) else: allowedDiskSet = devices.DiskSet() self.storDevList = storage_utils.getStorageList( allowedDiskSet, esxAndCos=not skipEsxDevice)
def __init__(self, parent, skipEsxDevice=True): """Initialize using parent's environment. Generates self.storDevList - list of allowable storage devices. """ super(ChooseDataStoreDevice, self).__init__() self.substep = self.start = self.showDevices self.scrollable = None self.parent = parent self.selectedDevice = None if skipEsxDevice: allowedDiskSet = pruneDiskSet(devices.DiskSet(), [self.parent.esxDeviceName]) else: allowedDiskSet = devices.DiskSet() self.storDevList = storage_utils.getStorageList(allowedDiskSet, esxAndCos=not skipEsxDevice)