Exemple #1
0
    def updateMenus(self):
        self.createPartition.setVisible(True)
        activatePartition = False
        freePartition = hasFreeDiskSpace(self.storage)
        if freePartition:
            activatePartition = True

        activateVolumeGroup = False
        availablePVS = len(self.storage.unusedPVS())
        if (lvm.has_lvm() and
                formats.getFormat("lvmpv").supported and
                availablePVS > 0):
            activateVolumeGroup = True

        activateRaidArray = False
        availableRaidMembers = len(self.storage.unusedRaidMembers())
        availableMinors = len(self.storage.unusedRaidMinors)
        if (availableMinors > 0
                and formats.getFormat("software RAID").supported
                and availableRaidMembers > 1):
            activateRaidArray = True


        """if (not activatePartition and not activateVolumeGroup):
            self.intf.messageWindow(_("Cannot perform any creation operation"),
                                    _("Note that the creation operation requires one of the\nfollowing:"
                                      " * Free space in one of the Hard Drives.\n"
                                      " * At least one free physical volume (LVM) partition.\n"
                                      " * At least one Volume Group with free space."),
                                    customIcon="warning")
            return"""

        freeVolumeGroupSpace = []
        for vg in self.storage.vgs:
            if vg.freeSpace > 0:
                freeVolumeGroupSpace.append(vg)

        activateLogicalVolume = False
        if len(freeVolumeGroupSpace) > 0:
            activateLogicalVolume = True

        if activatePartition:
            self.createPartition.setVisible(True)
            self.createPhysicalVolume.setVisible(True)
            self.createRaidMember.setVisible(True)

        if activateVolumeGroup:
            self.createVolumeGroup.setVisible(True)
            self.createLogicalVolume.setVisible(True)

        if activateLogicalVolume:
            #FIXME: find way to show only logical volume editor
            pass

        if activateRaidArray:
            self.createRaidArray.setVisible(True)
    def updateMenus(self):
        self.createPartition.setVisible(True)
        activatePartition = False

        try:
            freePartition = hasFreeDiskSpace(self.storage)
        except AttributeError, msg:
            ctx.logger.debug(msg)
        else:
            if freePartition:
                activatePartition = True

        activateVolumeGroup = False
        availablePVS = len(self.storage.unusedPVS())
        if (lvm.has_lvm() and formats.getFormat("lvmpv").supported
                and availablePVS > 0):
            activateVolumeGroup = True

        activateRaidArray = False
        availableRaidMembers = len(self.storage.unusedRaidMembers())
        availableMinors = len(self.storage.unusedRaidMinors)
        if (availableMinors > 0 and formats.getFormat("mdmember").supported
                and availableRaidMembers > 1):
            activateRaidArray = True
        """if (not activatePartition and not activateVolumeGroup):
            self.intf.messageWindow(_("Cannot perform any creation operation"),
                                    _("Note that the creation operation requires one of the\nfollowing:"
                                      " * Free space in one of the Hard Drives.\n"
                                      " * At least one free physical volume (LVM) partition.\n"
                                      " * At least one Volume Group with free space."),
Exemple #3
0
    def updateMenus(self):
        self.createPartition.setVisible(True)
        activatePartition = False

        try:
            freePartition = hasFreeDiskSpace(self.storage)
        except AttributeError, msg:
            ctx.logger.debug(msg)
        else:
            if freePartition:
                activatePartition = True

        activateVolumeGroup = False
        availablePVS = len(self.storage.unusedPVS())
        if (lvm.has_lvm() and
                formats.getFormat("lvmpv").supported and
                availablePVS > 0):
            activateVolumeGroup = True

        activateRaidArray = False
        availableRaidMembers = len(self.storage.unusedRaidMembers())
        availableMinors = len(self.storage.unusedRaidMinors)
        if (availableMinors > 0
                and formats.getFormat("mdmember").supported
                and availableRaidMembers > 1):
            activateRaidArray = True


        """if (not activatePartition and not activateVolumeGroup):
            self.intf.messageWindow(_("Cannot perform any creation operation"),