Commit 30948aa6 authored by Guido Trotter's avatar Guido Trotter
Browse files

Get rid of constants.HT_HVM_DEFAULT_BOOT_ORDER

Confusingly, as a leftober from 1.2, there was a
constants.HT_HVM_DEFAULT_BOOT_ORDER constant, with a value opposite to
the default HV_BOOT_ORDER hv param that got enabled only if
HV_BOOT_ORDER was set to None. Since setting it to None is very
hard/impossible for the user, and we didn't handle other "empty" values
(False, ''), we'll just force the parameter to have a valid value (after
all we have a default, and that's the way we use hvparams) and get rid
of the old constant altoghether.

Reviewed-by: iustinp
parent 49b1d36e
......@@ -334,7 +334,6 @@ HTS_REQ_PORT = frozenset([HT_XEN_HVM, HT_KVM])
HTS_USE_VNC = frozenset([HT_XEN_HVM, HT_KVM])
VNC_PASSWORD_FILE = _autoconf.SYSCONFDIR + "/ganeti/vnc-cluster-password"
......@@ -493,7 +493,7 @@ class XenHvmHypervisor(XenHypervisor):
super(XenHvmHypervisor, cls).CheckParameterSyntax(hvparams)
# boot order verification
boot_order = hvparams[constants.HV_BOOT_ORDER]
if len(boot_order.strip("acdn")) != 0:
if not boot_order or len(boot_order.strip("acdn")) != 0:
raise errors.HypervisorError("Invalid boot order '%s' specified,"
" must be one or more of [acdn]" %
......@@ -567,10 +567,7 @@ class XenHvmHypervisor(XenHypervisor):
config.write("device_model = '/usr/lib64/xen/bin/qemu-dm'\n")
config.write("device_model = '/usr/lib/xen/bin/qemu-dm'\n")
if instance.hvparams[constants.HV_BOOT_ORDER] is None:
config.write("boot = '%s'\n" % constants.HT_HVM_DEFAULT_BOOT_ORDER)
config.write("boot = '%s'\n" % instance.hvparams["boot_order"])
config.write("boot = '%s'\n" % instance.hvparams[constants.HV_BOOT_ORDER])
config.write("sdl = 0\n")
config.write("usb = 1\n")
config.write("usbdevice = 'tablet'\n")
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