Commit 5155ede7 authored by Guido Trotter's avatar Guido Trotter
Browse files

Xen-HVM: Improve the invalid disk/nic type error

Copy the message from the KVM one, adding a missing 'the' and a list of
possible values, to help the user in his decision.

Reviewed-by: iustinp
parent 43440815
......@@ -515,12 +515,16 @@ class XenHvmHypervisor(XenHypervisor):
# device type checks
nic_type = hvparams[constants.HV_NIC_TYPE]
if nic_type not in constants.HT_HVM_VALID_NIC_TYPES:
raise errors.HypervisorError("Invalid NIC type %s specified for Xen HVM"
" hypervisor" % nic_type)
raise errors.HypervisorError("Invalid NIC type %s specified for the Xen"
" HVM hypervisor. Please choose one of: %s"
% (nic_type,
constants.HT_HVM_VALID_NIC_TYPES))
disk_type = hvparams[constants.HV_DISK_TYPE]
if disk_type not in constants.HT_HVM_VALID_DISK_TYPES:
raise errors.HypervisorError("Invalid disk type %s specified for Xen HVM"
" hypervisor" % disk_type)
raise errors.HypervisorError("Invalid disk type %s specified for the Xen"
" HVM hypervisor. Please choose one of: %s"
% (disk_type,
constants.HT_HVM_VALID_DISK_TYPES))
# vnc_bind_address verification
vnc_bind_address = hvparams[constants.HV_VNC_BIND_ADDRESS]
if vnc_bind_address is not None:
......
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