Commit 80411610 authored by Nikos Skalkotos's avatar Nikos Skalkotos
Browse files

Handle better images with distro="unknown"

If the ostype returned by libguestfs is valid and distro in unknown,
don't print the distro at all.
parent 2dcd42b7
......@@ -99,7 +99,8 @@ def create_image(d, media, out, tmp):
"image creation process?\n\nChoose <Wizard> to run the wizard," \
" <Expert> to run the snf-image-creator in expert mode or " \
"press ESC to quit the program." \
% (image.ostype if image.ostype == image.distro else "%s (%s)" %
% (image.ostype if image.ostype == image.distro or
image.distro == "unknown" else "%s (%s)" %
(image.ostype, image.distro))
......@@ -107,7 +107,9 @@ class Image(object):
self.ostype = self.g.inspect_get_type(self.root)
self.distro = self.g.inspect_get_distro(self.root)
self.out.success('found a(n) %s system' % self.distro)
'found a(n) %s system' %
self.ostype if self.distro == "unknown" else self.distro)
def _get_os(self):
"""Return an OS class instance for this image"""
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment