Fix a bug introduced in commit e108efd285b34d5a28e
authorNikos Skalkotos <skalkoto@grnet.gr>
Sun, 29 Apr 2012 09:56:52 +0000 (12:56 +0300)
committerNikos Skalkotos <skalkoto@grnet.gr>
Sun, 29 Apr 2012 09:56:52 +0000 (12:56 +0300)
Not all needed code parts where updated when the size() method in
DiskDevice class was abandoned in favor of the size attribute.

image_creator/disk.py

index 2fb8039..4103e10 100644 (file)
@@ -271,15 +271,15 @@ class DiskDevice(object):
 
         last_partition = self.g.part_list(self.guestfs_device)[-1]
 
-        if last_partition['part_num'] > 4:
+        if self.parttype == 'msdos' and last_partition['part_num'] > 4:
             raise FatalError("This disk contains logical partitions. "
                 "Only primary partitions are supported.")
 
         part_dev = "%s%d" % (self.guestfs_device, last_partition['part_num'])
         fs_type = self.g.vfs_type(part_dev)
         if not re.match("ext[234]", fs_type):
-            warn("Don't know how to resize %s partitions." % vfs_type)
-            return self.size()
+            warn("Don't know how to resize %s partitions." % fs_type)
+            return self.size
 
         self.g.e2fsck_f(part_dev)
         self.g.resize2fs_M(part_dev)