Merge remote-tracking branch 'upstream/2014.7' into merge-forward-2015.5

This commit is contained in:
Colton Myers 2015-05-18 11:26:33 -06:00
commit c9ed23394c
3 changed files with 10 additions and 4 deletions

View file

@ -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

View file

@ -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)

View file

@ -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