Support pyparted 3.4
authorNikos Skalkotos <skalkoto@grnet.gr>
Sat, 26 Jan 2013 13:50:19 +0000 (15:50 +0200)
committerNikos Skalkotos <skalkoto@grnet.gr>
Sat, 26 Jan 2013 13:50:19 +0000 (15:50 +0200)
Use length instead of getLength() to get the size in sectors of a
device.

image_creator/bundle_volume.py

index 4b15acd..3eb810a 100644 (file)
@@ -170,7 +170,7 @@ class BundleVolume(object):
 
     def _shrink_partitions(self, image):
 
-        new_end = self.disk.device.getLength()
+        new_end = self.disk.device.length
 
         image_dev = parted.Device(image)
         image_disk = parted.Disk(image_dev)
@@ -420,7 +420,7 @@ class BundleVolume(object):
         running system.
         """
 
-        size = self.disk.device.getLength() * self.disk.device.sectorSize
+        size = self.disk.device.length * self.disk.device.sectorSize
 
         # Create sparse file to host the image
         fd = os.open(image, os.O_WRONLY | os.O_CREAT)