diff options
author | Ryan Lane <rlane@wikimedia.org> | 2011-01-27 12:17:43 +0000 |
---|---|---|
committer | Ryan Lane <rlane@wikimedia.org> | 2011-01-27 12:17:43 +0000 |
commit | c02a587ea03fecde26f49bec52f8d96aa551979a (patch) | |
tree | 68e236b508d5019812bf7de65fc1a209d0df474f /nova/utils.py | |
parent | fc8f41e9c34c8d14d1c66ca03ce7098cc6b7f04d (diff) | |
parent | caca4a1320638b0d806f1854ba8233d941f50e86 (diff) | |
download | nova-c02a587ea03fecde26f49bec52f8d96aa551979a.tar.gz nova-c02a587ea03fecde26f49bec52f8d96aa551979a.tar.xz nova-c02a587ea03fecde26f49bec52f8d96aa551979a.zip |
Merge from trunk
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..5f5225289 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 %(interface)s" + " :%(ex)s") % locals()) def to_global_ipv6(prefix, mac): |