summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
authorHisaharu Ishii <ishii.hisaharu@lab.ntt.co.jp>2011-01-27 10:08:30 +0000
committerTarmac <>2011-01-27 10:08:30 +0000
commit0a6ab4362284d92cddd22ee6bfa4182c64299064 (patch)
treec67d721ed0203533fc38864552f2e0c0bdffcf1b /nova/utils.py
parentabb1111ee67d1d157b249c004584dfc16642536e (diff)
parent6273b2f95a905d98c217e98c1dbfc46b097b7533 (diff)
downloadnova-0a6ab4362284d92cddd22ee6bfa4182c64299064.tar.gz
nova-0a6ab4362284d92cddd22ee6bfa4182c64299064.tar.xz
nova-0a6ab4362284d92cddd22ee6bfa4182c64299064.zip
Fix Bug #703037. ra_server is None
Diffstat (limited to 'nova/utils.py')
-rw-r--r--nova/utils.py16
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):