Commit daa49d6f authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Fix error during cluster initialization due to hv_kvm

Commit 141d1489

 was a bit too enthusiastic. The three parameters added to
the list of parameters to be checked default to a value not evaluating
to false, leading to a failure on cluster initialization.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 114e8500
......@@ -77,9 +77,6 @@ _SPICE_ADDITIONAL_PARAMS = frozenset([
constants.HV_KVM_SPICE_ZLIB_GLZ_IMG_COMPR,
constants.HV_KVM_SPICE_STREAMING_VIDEO_DETECTION,
constants.HV_KVM_SPICE_USE_TLS,
constants.HV_KVM_SPICE_AUDIO_COMPR,
constants.HV_KVM_SPICE_TLS_CIPHERS,
constants.HV_KVM_SPICE_USE_VDAGENT,
])
......
......@@ -260,13 +260,29 @@ class TestVersionChecking(testutils.GanetiTestCase):
class TestSpiceParameterList(unittest.TestCase):
def test(self):
defaults = constants.HVC_DEFAULTS[constants.HT_KVM]
params = \
compat.UniqueFrozenset(getattr(constants, name)
for name in dir(constants)
if name.startswith("HV_KVM_SPICE_"))
# Parameters whose default value evaluates to True and don't need to be set
defaults_true = frozenset(filter(defaults.__getitem__, params))
self.assertEqual(defaults_true, frozenset([
constants.HV_KVM_SPICE_AUDIO_COMPR,
constants.HV_KVM_SPICE_USE_VDAGENT,
constants.HV_KVM_SPICE_TLS_CIPHERS,
]))
# HV_KVM_SPICE_BIND decides whether the other parameters must be set if
# their default evaluates to False
assert constants.HV_KVM_SPICE_BIND in params
assert constants.HV_KVM_SPICE_BIND not in defaults_true
# Exclude some parameters
params -= frozenset([
params -= defaults_true | frozenset([
constants.HV_KVM_SPICE_BIND,
])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment