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

Aline Manera alinefm at linux.vnet.ibm.com
Mon Jul 21 18:14:16 UTC 2014


Reviewed-by: Aline Manera <alinefm at linux.vnet.ibm.com>

On 07/20/2014 12:08 PM, lvroyce0210 at gmail.com wrote:
> 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)
>




More information about the Kimchi-devel mailing list