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: Andrea Spadaccini <spadaccio@google.com>
Signed-off-by: Guido Trotter <ultrotter@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>
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]