Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Devel #1565

Merged
merged 2 commits into from
May 29, 2024
Merged

Devel #1565

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions IM/connectors/OpenStack.py
Original file line number Diff line number Diff line change
Expand Up @@ -725,12 +725,19 @@ def setIPsFromInstance(self, vm, node):
ip_net_map = {}

for net_name, ips in node.extra['addresses'].items():
# Check if the network is private using only IPv4 IP
is_private = None
for ipo in ips:
ip = ipo['addr']
if IPAddress(ip).version == 4:
is_private = any([IPAddress(ip) in IPNetwork(mask) for mask in Config.PRIVATE_NET_MASKS])
else:
is_private = IPAddress(ip).is_ipv6_unique_local()
if is_private is None:
self.log_warn("Error getting network type for network %s. Asumming public." % net_name)
is_private = False

# Now map the IPs
for ipo in ips:
ip = ipo['addr']

if 'OS-EXT-IPS:type' in ipo and ipo['OS-EXT-IPS:type'] == 'floating':
ip_net_map[ip] = (None, not is_private)
Expand Down