diff options
author | Todd Willey <todd@ansolabs.com> | 2011-01-27 15:58:22 -0800 |
---|---|---|
committer | Todd Willey <todd@ansolabs.com> | 2011-01-27 15:58:22 -0800 |
commit | f61da82b6dc614867028e39eec71ed98de8bfac7 (patch) | |
tree | e935ca43b096cd8c79584c49ad32b42d30b0b69a /nova/utils.py | |
parent | 4b4781f5cc015c80c9acb0625aaeac9cde667d4b (diff) | |
parent | d4f77e1c9eaad19f2a917081737840f9e52dac13 (diff) | |
download | nova-f61da82b6dc614867028e39eec71ed98de8bfac7.tar.gz nova-f61da82b6dc614867028e39eec71ed98de8bfac7.tar.xz nova-f61da82b6dc614867028e39eec71ed98de8bfac7.zip |
Merge & fix conflict.
Diffstat (limited to 'nova/utils.py')
-rw-r--r-- | nova/utils.py | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/nova/utils.py b/nova/utils.py index 2f3bd2894..f71a4d880 100644 --- a/nova/utils.py +++ b/nova/utils.py @@ -206,21 +206,17 @@ def last_octet(address): def get_my_linklocal(interface): try: if_str = execute("ip -f inet6 -o addr show %s" % interface) - condition = "\s+inet6\s+([0-9a-f:]+/\d+)\s+scope\s+link" + condition = "\s+inet6\s+([0-9a-f:]+)/\d+\s+scope\s+link" links = [re.search(condition, x) for x in if_str[0].split('\n')] address = [w.group(1) for w in links if w is not None] if address[0] is not None: return address[0] else: - return 'fe00::' - except IndexError as ex: - LOG.warn(_("Couldn't get Link Local IP of %(interface)s :%(ex)s") - % locals()) - except ProcessExecutionError as ex: - LOG.warn(_("Couldn't get Link Local IP of %(interface)s :%(ex)s") - % locals()) - except: - return 'fe00::' + raise exception.Error(_("Link Local address is not found.:%s") + % if_str) + except Exception as ex: + raise exception.Error(_("Couldn't get Link Local IP of %s :%s") + % (interface, ex)) def to_global_ipv6(prefix, mac): |