Fix a bug in image shrinking code
authorNikos Skalkotos <skalkoto@grnet.gr>
Fri, 21 Dec 2012 10:00:54 +0000 (12:00 +0200)
committerNikos Skalkotos <skalkoto@grnet.gr>
Fri, 21 Dec 2012 10:06:04 +0000 (12:06 +0200)
Credits go to Giannis Spiliopoulos <gspilio@admin.grnet.gr>

image_creator/disk.py

index 40e1316..8582428 100644 (file)
@@ -381,7 +381,7 @@ class DiskDevice(object):
                     'num': partition['part_num'],
                     'start': partition['part_start'] / sector_size,
                     'end': partition['part_end'] / sector_size,
                     'num': partition['part_num'],
                     'start': partition['part_start'] / sector_size,
                     'end': partition['part_end'] / sector_size,
-                    'id': part_get_(partition['part_num']),
+                    'id': part_get_id(partition['part_num']),
                     'bootable': part_get_bootable(partition['part_num'])
                 })
 
                     'bootable': part_get_bootable(partition['part_num'])
                 })
 
@@ -390,7 +390,7 @@ class DiskDevice(object):
             # Recreate the extended partition
             extended = [p for p in partitions if self._is_extended(p)][0]
             part_del(extended['part_num'])
             # Recreate the extended partition
             extended = [p for p in partitions if self._is_extended(p)][0]
             part_del(extended['part_num'])
-            part_add('e', extended['part_start'], end)
+            part_add('e', extended['part_start'] / sector_size, end)
 
             # Create all the logical partitions back
             for l in logical:
 
             # Create all the logical partitions back
             for l in logical: