summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
authorHisaharu Ishii <ishii.hisaharu@lab.ntt.co.jp>2011-01-12 18:37:18 +0900
committerHisaharu Ishii <ishii.hisaharu@lab.ntt.co.jp>2011-01-12 18:37:18 +0900
commit04cd3241f442f1c6a9fd030ab47b4d15e79ec032 (patch)
tree03435d9b52782dcae6670a2c5123da8241884c3d /nova/utils.py
parent6a4b4f0767f8518e57384ff88efafaa853d642a4 (diff)
downloadnova-04cd3241f442f1c6a9fd030ab47b4d15e79ec032.tar.gz
nova-04cd3241f442f1c6a9fd030ab47b4d15e79ec032.tar.xz
nova-04cd3241f442f1c6a9fd030ab47b4d15e79ec032.zip
Change command to get link local address
Remove superfluous code
Diffstat (limited to 'nova/utils.py')
-rw-r--r--nova/utils.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/nova/utils.py b/nova/utils.py
index 02bafc6c8..a13fa214c 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -212,8 +212,8 @@ def get_my_ip():
def get_my_linklocal(interface):
try:
- if_str = execute("ifconfig %s" % interface)
- condition = "\s+inet6\s+addr:\s+([0-9a-f:]+/\d+)\s+Scope:Link"
+ if_str = execute("ip -f inet6 -o addr show %s" % interface)
+ condition = "\s+inet6\s+([0-9a-f:]+/\d+)\s+scope: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: