diff --git a/lib/constants.py b/lib/constants.py index ec9bd668196dc8e56aca2b4f9c78e608c74326a1..0b43a128a4fecb60d2c3d2e01a0285491eed2872 100644 --- a/lib/constants.py +++ b/lib/constants.py @@ -334,7 +334,6 @@ HTS_REQ_PORT = frozenset([HT_XEN_HVM, HT_KVM]) HTS_USE_VNC = frozenset([HT_XEN_HVM, HT_KVM]) HT_HVM_VNC_BASE_PORT = 5900 -HT_HVM_DEFAULT_BOOT_ORDER = 'dc' VNC_PASSWORD_FILE = _autoconf.SYSCONFDIR + "/ganeti/vnc-cluster-password" VNC_DEFAULT_BIND_ADDRESS = '0.0.0.0' diff --git a/lib/hypervisor/hv_xen.py b/lib/hypervisor/hv_xen.py index 8b66b4aa77b972901dcf32331d31b45ddde57300..b34b221d5408577a2db6317f449d440b46290f1d 100644 --- a/lib/hypervisor/hv_xen.py +++ b/lib/hypervisor/hv_xen.py @@ -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]" % boot_order) @@ -567,10 +567,7 @@ class XenHvmHypervisor(XenHypervisor): config.write("device_model = '/usr/lib64/xen/bin/qemu-dm'\n") else: 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) - else: - 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")