[Pkg-escience-soc2009] [SCM] Tool for creating VM images. branch, master, updated. 171b0d8ea21e6a1cffe6c33e5d9ae7d9a844191a

Steffen Moeller steffen_moeller at gmx.de
Sun Jun 21 10:27:37 UTC 2009


The following commit has been merged in the master branch:
commit 171b0d8ea21e6a1cffe6c33e5d9ae7d9a844191a
Author: Steffen Moeller <steffen_moeller at gmx.de>
Date:   Sun Jun 21 12:25:21 2009 +0200

    Ensuring compatibility with latest parted
    
    There is a problem with the linux-swap -> linux-swap(new) rename
    that was apparently introduced in 2007.
    http://mail.python.org/pipermail/mailman-users/1999-December/002892.html
    
    What is missing is a version check of parted and - even preferably -
    a fix in parted.

diff --git a/VMBuilder/disk.py b/VMBuilder/disk.py
index 53878bf..95e1373 100644
--- a/VMBuilder/disk.py
+++ b/VMBuilder/disk.py
@@ -218,7 +218,13 @@ class Disk(object):
             @rtype: string
             @return: the filesystem type of the partition suitable for passing to parted
             """
-            return { TYPE_EXT2: 'ext2', TYPE_EXT3: 'ext2', TYPE_XFS: 'ext2', TYPE_SWAP: 'linux-swap' }[self.type]
+            if None:
+                return { TYPE_EXT2: 'ext2', TYPE_EXT3: 'ext2', TYPE_XFS: 'ext2', TYPE_SWAP: 'linux-swap' }[self.type]
+            else:
+                # latest parted versions (observed with parted (GNU parted) 1.8.8.1.159-1e0e in Debian sid) demand
+                # a different specification of the swap partition, see 
+                # http://www.mail-archive.com/bug-parted@gnu.org/msg02400.html
+                return { TYPE_EXT2: 'ext2', TYPE_EXT3: 'ext2', TYPE_XFS: 'ext2', TYPE_SWAP: 'linux-swap(new)' }[self.type]
 
         def create(self, disk):
             """Adds partition to the disk image (does not mkfs or anything like that)"""

-- 
Tool for creating VM images.



More information about the Pkg-escience-soc2009 mailing list