From: Nikos Skalkotos Date: Mon, 25 Jun 2012 11:39:09 +0000 (+0300) Subject: Use vfs_uuid instead of blkid to compute uuid X-Git-Tag: v0.1~58 X-Git-Url: https://code.grnet.gr/git/snf-image-creator/commitdiff_plain/20409e9f28eb8af1316aeb7ee3604e463ec3e264 Use vfs_uuid instead of blkid to compute uuid vfs_uuid is more suitable for this and it whas added before blkid in guestfs, hence it is supported in more guestfs versions. --- diff --git a/image_creator/os_type/linux.py b/image_creator/os_type/linux.py index e38e777..89d5e32 100644 --- a/image_creator/os_type/linux.py +++ b/image_creator/os_type/linux.py @@ -50,10 +50,10 @@ class Linux(Unix): if dev in self._uuid: return self._uuid[dev] - for attr in self.g.blkid(dev): - if attr[0] == 'UUID': - self._uuid[dev] = attr[1] - return attr[1] + uuid = self.g.vfs_uuid(dev) + assert len(uuid) + self._uuid[dev] = uuid + return uuid @sysprep() def fix_acpid(self, print_header=True):