From 1d8222d9eaeaa40658715f6a3d9e973ed32b4b09 Mon Sep 17 00:00:00 2001 From: Cole Robinson Date: Thu, 24 Mar 2011 11:37:26 -0400 Subject: [PATCH] config: Validate graphics type directly after reading Fixes an error in 'new vm' wizard if graphics_type is unset in gconf --- src/virtManager/config.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/virtManager/config.py b/src/virtManager/config.py index 0b703b31a..f551a065e 100644 --- a/src/virtManager/config.py +++ b/src/virtManager/config.py @@ -509,7 +509,10 @@ class vmmConfig(object): self.conf.notify_add(self.conf_dir + "/new-vm/remote-sound", cb, data) def get_graphics_type(self): - return self.conf.get_string(self.conf_dir + "/new-vm/graphics_type") + ret = self.conf.get_string(self.conf_dir + "/new-vm/graphics_type") + if ret not in ["vnc", "spice"]: + return "vnc" + return ret def set_graphics_type(self, gtype): self.conf.set_string(self.conf_dir + "/new-vm/graphics_type", gtype.lower())