[et-mgmt-tools] [PATCH] Fixes the error when Windows is installed with "-- os-variant" option

Masayuki Sunou fj1826dm at aa.jp.fujitsu.com
Wed May 30 23:29:07 UTC 2007


When I install Windows with "-- os-variant" option, virt-install outputs the
following errors.

# virt-install --name TEST --ram 256 --vnc --hvm --cdrom /mnt/WinSrv2k3sp1/Win2003_Sp1.iso
 --os-type="windows" --os-variant="win2k" --file /dev/sda8

Starting install...
libvir: Xen Daemon error : GET operation failed: 
Domain installation may not have been
successful.  If it was, you can restart your domain
by running 'virsh start TEST'; otherwise, please
restart your installation.
Wed, 30 May 2007 13:05:57 ERROR    'distro'
Traceback (most recent call last):
  File "/usr/bin/virt-install", line 647, in <module>
  File "/usr/bin/virt-install", line 607, in main
    dom = guest.start_install(conscb,progresscb)
  File "/usr/lib/python2.5/site-packages/virtinst/Guest.py", line 668, in start_install
  File "/usr/lib/python2.5/site-packages/virtinst/FullVirtGuest.py", line 195, in _prepare_install
    distro = self.os_distro)
  File "/usr/lib/python2.5/site-packages/virtinst/FullVirtGuest.py", line 148, in get_os_distro
    return FullVirtGuest.OS_TYPES[self.os_type]["variants"][self.os_variant]["distro""]
KeyError: 'distro'

This patch fixes it.

Signed-off-by: Masayuki Sunou <fj1826dm at aa.jp.fujitsu.com>

Masayuki Sunou.

diff -r 7fd35e3303c6 virtinst/FullVirtGuest.py
--- a/virtinst/FullVirtGuest.py	Fri May 25 10:49:47 2007 -0400
+++ b/virtinst/FullVirtGuest.py	Wed May 30 13:23:48 2007 +0900
@@ -144,7 +144,7 @@ class FullVirtGuest(Guest.XenGuest):
                 self.features["apic"] = FullVirtGuest.OS_TYPES[os_type]["apic"]
     def get_os_distro(self):
-        if self.os_type is not None and self.os_variant is not None:
+        if self.os_type is not None and self.os_variant is not None and "distro" in FullVirtGuest.OS_TYPES[self.os_type]["variants"][self.os_variant]:
             return FullVirtGuest.OS_TYPES[self.os_type]["variants"][self.os_variant]["distro"]
         return None
     os_distro = property(get_os_distro)

More information about the et-mgmt-tools mailing list