mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge branch '2015.5' of https://github.com/saltstack/salt into 2015.5
This commit is contained in:
commit
ef581283fa
3 changed files with 10 additions and 4 deletions
|
@ -808,8 +808,8 @@ def get_nics(vm_):
|
|||
if v_node.tagName == 'virtualport':
|
||||
temp = {}
|
||||
temp['type'] = v_node.getAttribute('type')
|
||||
for key in v_node.attributes:
|
||||
temp[key] = v_node.getAttribute(key)
|
||||
for key, value in v_node.attributes.items():
|
||||
temp[key] = value
|
||||
nic['virtualport'] = temp
|
||||
if 'mac' not in nic:
|
||||
continue
|
||||
|
|
|
@ -324,8 +324,8 @@ def _gen_keep_files(name, require):
|
|||
'''
|
||||
Check whether ``path`` is child of ``directory``
|
||||
'''
|
||||
path = os.path.realpath(path)
|
||||
directory = os.path.realpath(directory)
|
||||
path = os.path.abspath(path)
|
||||
directory = os.path.abspath(directory)
|
||||
|
||||
relative = os.path.relpath(path, directory)
|
||||
|
||||
|
|
|
@ -1834,6 +1834,12 @@ def is_public_ip(ip):
|
|||
'''
|
||||
Determines whether an IP address falls within one of the private IP ranges
|
||||
'''
|
||||
if ':' in ip:
|
||||
# ipv6
|
||||
if ip.startswith('fe80:'):
|
||||
# ipv6 link local
|
||||
return False
|
||||
return True
|
||||
addr = ip_to_int(ip)
|
||||
if addr > 167772160 and addr < 184549375:
|
||||
# 10.0.0.0/24
|
||||
|
|
Loading…
Add table
Reference in a new issue