Commit 981fb275 authored by Arnaud Fontaine's avatar Arnaud Fontaine

When using bridge with no IPv6 address, display a meaningful error message.

parent 43af8f2b
...@@ -605,8 +605,12 @@ class Bridge: ...@@ -605,8 +605,12 @@ class Bridge:
def getGlobalScopeAddressList(self): def getGlobalScopeAddressList(self):
"""Returns currently configured global scope IPv6 addresses""" """Returns currently configured global scope IPv6 addresses"""
address_list = [q for q in netifaces.ifaddresses(self.name)[socket.AF_INET6] try:
if isGlobalScopeAddress(q['addr'].split('%')[0])] address_list = [q for q in netifaces.ifaddresses(self.name)[socket.AF_INET6]
if isGlobalScopeAddress(q['addr'].split('%')[0])]
except KeyError:
raise ValueError("%s must have at least one IPv6 address assigned" % \
self.name)
# XXX: Missing implementation of Unique Local IPv6 Unicast Addresses as # XXX: Missing implementation of Unique Local IPv6 Unicast Addresses as
# defined in http://www.rfc-editor.org/rfc/rfc4193.txt # defined in http://www.rfc-editor.org/rfc/rfc4193.txt
# XXX: XXX: XXX: IT IS DISALLOWED TO IMPLEMENT link-local addresses as # XXX: XXX: XXX: IT IS DISALLOWED TO IMPLEMENT link-local addresses as
......
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