[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[virt-tools-list] [PATCH] Fix NoneType exception when connecting to VMware ESX



I just tested virt-manager with VMware ESX and found a problem in virt-install.

Matthias
# HG changeset patch
# User Matthias Bolte <matthias bolte googlemail com>
# Date 1259887114 -3600
# Node ID 56fcec89f06f2dedecb1b937c31d24ff14f9a44e
# Parent  269a7225fef1bdfe590df6cf29734c569184f0f0
Check if emulator element is present before accessing it

VMware ESX capabilities don't contain an emulator element. Virt Manager
reports a NoneType exception when trying to connect to an ESX server.

diff -r 269a7225fef1 -r 56fcec89f06f virtinst/CapabilitiesParser.py
--- a/virtinst/CapabilitiesParser.py	Thu Dec 03 16:07:11 2009 -0500
+++ b/virtinst/CapabilitiesParser.py	Fri Dec 04 01:38:34 2009 +0100
@@ -309,7 +309,7 @@
             if g.os_type != "hvm" or g.arch != "x86_64":
                 continue
             for d in g.domains:
-                if d.emulator.find("lib64") != -1:
+                if d.emulator is not None and d.emulator.find("lib64") != -1:
                     fixEmulator = d.emulator
 
         if not fixEmulator:
@@ -319,7 +319,7 @@
             if g.os_type != "hvm" or g.arch != "i686":
                 continue
             for d in g.domains:
-                if d.emulator.find("lib64") == -1:
+                if d.emulator is not None and d.emulator.find("lib64") == -1:
                     d.emulator = fixEmulator
 
     def parseXML(self, node):

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]