Beispiel #1
0
 def __init__(self):
     self.pare = Storage()
Beispiel #2
0
 def __init__(self):
     self.pare = Storage()
Beispiel #3
0
class Test(object):


    def __init__(self):
        self.pare = Storage()

    def listDisks(self):
        return self.pare.disks
        #for disk in disks:
         #   print "disk.path:%s" % disk.path
        return disks

    def listPartitions(self, disk):
        for part in self.pare.diskPartitions(disk):
                print "listPartitions--->   %s  partition path %s" % (disk.name, part.path)

    def physicalVolumes(self, disk):
        return self.pare.physicalVolumes(disk)

    def volumeGroups(self):
        vgs = self.pare.volumeGroups
        for vg in vgs:
            print "volumeGroups--> %s" % vg.name 

    def logicalVolumes(self):
        lvs = self.pare.logicalVolumes
        for lv in lvs:
            print "list logicalVolumes--> %s" % lv.name
        return lvs

    def addPartition(self, disk, partition,type, size, filesystem, flags):
        self.pare.addPartition(disk, partition, type, filesystem, size, flags)

    def getDiskPartition(self, disk, minor):
        return self.pare.getPartition(disk, minor)

    def commit2Disk(self, disk):
        self.pare.commitToDisk(disk)

    def deleteDiskPartition(self, disk, partition):
        self.pare.deletePartition(disk, partition)

    def removeLV(self, lv):
        print "lv.path : %s" % lv.path 
        self.pare.removeLV(lv)
Beispiel #4
0
class Test(object):
    def __init__(self):
        self.pare = Storage()

    def listDisks(self):
        return self.pare.disks
        #for disk in disks:
        #   print "disk.path:%s" % disk.path
        return disks

    def listPartitions(self, disk):
        for part in self.pare.diskPartitions(disk):
            print "listPartitions--->   %s  partition path %s" % (disk.name,
                                                                  part.path)

    def physicalVolumes(self, disk):
        return self.pare.physicalVolumes(disk)

    def volumeGroups(self):
        vgs = self.pare.volumeGroups
        for vg in vgs:
            print "volumeGroups--> %s" % vg.name

    def logicalVolumes(self):
        lvs = self.pare.logicalVolumes
        for lv in lvs:
            print "list logicalVolumes--> %s" % lv.name
        return lvs

    def addPartition(self, disk, partition, type, size, filesystem, flags):
        self.pare.addPartition(disk, partition, type, filesystem, size, flags)

    def getDiskPartition(self, disk, minor):
        return self.pare.getPartition(disk, minor)

    def commit2Disk(self, disk):
        self.pare.commitToDisk(disk)

    def deleteDiskPartition(self, disk, partition):
        self.pare.deletePartition(disk, partition)

    def removeLV(self, lv):
        print "lv.path : %s" % lv.path
        self.pare.removeLV(lv)