diff options
| author | Hisaharu Ishii <ishii.hisaharu@lab.ntt.co.jp> | 2011-01-12 18:37:18 +0900 |
|---|---|---|
| committer | Hisaharu Ishii <ishii.hisaharu@lab.ntt.co.jp> | 2011-01-12 18:37:18 +0900 |
| commit | 04cd3241f442f1c6a9fd030ab47b4d15e79ec032 (patch) | |
| tree | 03435d9b52782dcae6670a2c5123da8241884c3d | |
| parent | 6a4b4f0767f8518e57384ff88efafaa853d642a4 (diff) | |
| download | nova-04cd3241f442f1c6a9fd030ab47b4d15e79ec032.tar.gz nova-04cd3241f442f1c6a9fd030ab47b4d15e79ec032.tar.xz nova-04cd3241f442f1c6a9fd030ab47b4d15e79ec032.zip | |
Change command to get link local address
Remove superfluous code
| -rw-r--r-- | nova/utils.py | 4 | ||||
| -rw-r--r-- | nova/virt/libvirt_conn.py | 1 |
2 files changed, 2 insertions, 3 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: diff --git a/nova/virt/libvirt_conn.py b/nova/virt/libvirt_conn.py index c6827edbe..e5f61f9aa 100644 --- a/nova/virt/libvirt_conn.py +++ b/nova/virt/libvirt_conn.py @@ -1024,7 +1024,6 @@ class NWFilterFirewall(FirewallDriver): security_group = db.security_group_get(context.get_admin_context(), security_group_id) rule_xml = "" - version = 4 v6protocol = {'tcp': 'tcp-ipv6', 'udp': 'udp-ipv6', 'icmp': 'icmpv6'} for rule in security_group.rules: rule_xml += "<rule action='accept' direction='in' priority='300'>" |
