Commit b845c8a1 authored by Andrea Spadaccini's avatar Andrea Spadaccini Committed by Guido Trotter
Browse files

Handle network interfaces without IPs



If the user specified a network interface with no IPs, he would receive
an unhelpful "list index out of range" error. Fixed that.
Signed-off-by: default avatarAndrea Spadaccini <spadaccio@google.com>
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarGuido Trotter <ultrotter@google.com>
parent 11ae7a0a
......@@ -747,8 +747,11 @@ class KVMHypervisor(hv_base.BaseHypervisor):
cluster_family)
elif addresses[constants.IP4_VERSION]:
spice_ip_version = constants.IP4_VERSION
else:
elif addresses[constants.IP6_VERSION]:
spice_ip_version = constants.IP6_VERSION
else:
raise errors.HypervisorError("spice: unable to get an IP address"
" for %s" % (spice_bind))
spice_address = addresses[spice_ip_version][0]
......
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