コード例 #1
0
    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})
コード例 #2
0
ファイル: esxlocation_ui.py プロジェクト: vmware/weasel
    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} )
コード例 #3
0
    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
コード例 #4
0
ファイル: esxlocation_ui.py プロジェクト: vmware/weasel
    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
コード例 #5
0
    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)
コード例 #6
0
ファイル: datastore_ui.py プロジェクト: vmware/weasel
    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)