[Kimchi-devel] [PATCHv3 5/8] Integrate image os probe in vm template create

lvroyce0210 at gmail.com lvroyce0210 at gmail.com
Sun Jul 20 15:08:02 UTC 2014


From: Royce Lv <lvroyce at linux.vnet.ibm.com>

When we supply base image, we need to probe its os to choose
a proper system configuration for it.

Signed-off-by: Royce Lv <lvroyce at linux.vnet.ibm.com>
---
 src/kimchi/vmtemplate.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/kimchi/vmtemplate.py b/src/kimchi/vmtemplate.py
index 0903b7f..9e8ed3d 100644
--- a/src/kimchi/vmtemplate.py
+++ b/src/kimchi/vmtemplate.py
@@ -52,7 +52,7 @@ class VMTemplate(object):
         self.fc_host_support = args.get('fc_host_support')
 
         # Identify the cdrom if present
-        iso_distro = iso_version = 'unknown'
+        distro = version = 'unknown'
         iso = args.get('cdrom', '')
 
         # if ISO not specified and base disk image specified,
@@ -69,13 +69,13 @@ class VMTemplate(object):
                     break
 
         if scan and len(iso) > 0:
-            iso_distro, iso_version = self.get_iso_info(iso)
+            distro, version = self.get_iso_info(iso)
             if not iso.startswith('/'):
                 self.info.update({'iso_stream': True})
 
         # Fetch defaults based on the os distro and version
-        os_distro = args.get('os_distro', iso_distro)
-        os_version = args.get('os_version', iso_version)
+        os_distro = args.get('os_distro', distro)
+        os_version = args.get('os_version', version)
         entry = osinfo.lookup(os_distro, os_version)
         self.info.update(entry)
 
-- 
1.8.3.2




More information about the Kimchi-devel mailing list