Martin Polednik has uploaded a new change for review.

Change subject: virt: catch possible TypeError when parsing graphics
......................................................................

virt: catch possible TypeError when parsing graphics

When parsing graphics devices, we ignore the devices we don't know.
When VM is started without graphics device and then it is found in
domain XML, getFirstGraphics will fail with unhandled TypeError. This
TypeError can be safely ignored, as no change to conf could be made
anyway.

Change-Id: Ibc9a7237f03b3e9953f2db621f3ec1e4baf80550
Signed-off-by: Martin Polednik <[email protected]>
---
M vdsm/virt/vmdevices/graphics.py
1 file changed, 7 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/89/39989/1

diff --git a/vdsm/virt/vmdevices/graphics.py b/vdsm/virt/vmdevices/graphics.py
index d352b79..c4b16d3 100644
--- a/vdsm/virt/vmdevices/graphics.py
+++ b/vdsm/virt/vmdevices/graphics.py
@@ -164,10 +164,13 @@
 
 def updateLegacyConf(conf):
     dev = getFirstGraphics(conf)
-    if 'port' in dev:
-        conf['displayPort'] = dev['port']
-    if 'tlsPort' in dev:
-        conf['displaySecurePort'] = dev['tlsPort']
+    try:
+        if 'port' in dev:
+            conf['displayPort'] = dev['port']
+        if 'tlsPort' in dev:
+            conf['displaySecurePort'] = dev['tlsPort']
+    except TypeError:
+        pass
 
 
 def getFirstGraphics(conf):


-- 
To view, visit https://gerrit.ovirt.org/39989
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibc9a7237f03b3e9953f2db621f3ec1e4baf80550
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Martin Polednik <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to