From d8a12a7ee6817c93a400af602ebf1366c1309cbb Mon Sep 17 00:00:00 2001 From: Nikos Skalkotos Date: Tue, 21 May 2013 17:08:40 +0300 Subject: [PATCH] Copy OSFAMILY to OS property if distro is unknown If libguestfs's inspect_get_distro returns "unknown", then use the OSFAMILY image property value as OS value. --- image_creator/os_type/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/image_creator/os_type/__init__.py b/image_creator/os_type/__init__.py index 92dde0d..181bf5d 100644 --- a/image_creator/os_type/__init__.py +++ b/image_creator/os_type/__init__.py @@ -82,6 +82,8 @@ class OSBase(object): self.meta['ROOT_PARTITION'] = "%d" % self.g.part_to_partnum(self.root) self.meta['OSFAMILY'] = self.g.inspect_get_type(self.root) self.meta['OS'] = self.g.inspect_get_distro(self.root) + if self.meta['OS'] == "unknown": + self.meta['OS'] = self.meta['OSFAMILY'] self.meta['DESCRIPTION'] = self.g.inspect_get_product_name(self.root) def _is_sysprep(self, obj): -- 1.7.10.4