projects
/
snf-image-creator
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
6d7f7fc
)
Copy OSFAMILY to OS property if distro is unknown
author
Nikos Skalkotos
<skalkoto@grnet.gr>
Tue, 21 May 2013 14:08:40 +0000
(17:08 +0300)
committer
Nikos Skalkotos
<skalkoto@grnet.gr>
Tue, 21 May 2013 14:08:40 +0000
(17:08 +0300)
If libguestfs's inspect_get_distro returns "unknown", then use the
OSFAMILY image property value as OS value.
image_creator/os_type/__init__.py
patch
|
blob
|
history
diff --git
a/image_creator/os_type/__init__.py
b/image_creator/os_type/__init__.py
index
92dde0d
..
181bf5d
100644
(file)
--- 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):