Change command to get link local address
Remove superfluous code
This commit is contained in:
parent
6a4b4f0767
commit
04cd3241f4
|
@ -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:
|
||||
|
|
|
@ -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'>"
|
||||
|
|
Loading…
Reference in New Issue