mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-11 16:05:51 -06:00
config: Validate graphics type directly after reading
Fixes an error in 'new vm' wizard if graphics_type is unset in gconf
This commit is contained in:
parent
3b2cba5b1a
commit
1d8222d9ea
@ -509,7 +509,10 @@ class vmmConfig(object):
|
|||||||
self.conf.notify_add(self.conf_dir + "/new-vm/remote-sound", cb, data)
|
self.conf.notify_add(self.conf_dir + "/new-vm/remote-sound", cb, data)
|
||||||
|
|
||||||
def get_graphics_type(self):
|
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):
|
def set_graphics_type(self, gtype):
|
||||||
self.conf.set_string(self.conf_dir + "/new-vm/graphics_type",
|
self.conf.set_string(self.conf_dir + "/new-vm/graphics_type",
|
||||||
gtype.lower())
|
gtype.lower())
|
||||||
|
Loading…
Reference in New Issue
Block a user