mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-03-12 20:58:28 +03:00
graphics: Fix default autoport value
default_cb doesn't want yes/no, it wants True/False
This commit is contained in:
parent
b86c5b21ec
commit
288a611ff7
@ -139,8 +139,10 @@ class VirtualGraphics(VirtualDevice):
|
||||
def _get_default_autoport(self):
|
||||
# By default, don't do this for VNC to maintain back compat with
|
||||
# old libvirt that didn't support 'autoport'
|
||||
if self.type == "spice":
|
||||
return (self.port == -1 or self.tlsPort == -1) and "yes" or "no"
|
||||
if self.type != "spice":
|
||||
return None
|
||||
if (self.port == -1 or self.tlsPort == -1):
|
||||
return True
|
||||
return None
|
||||
port = XMLProperty(xpath="./@port", is_int=True,
|
||||
set_converter=lambda s, v: _validate_port("Port", v),
|
||||
|
Loading…
x
Reference in New Issue
Block a user