Commit 7782c001 authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

cyclades: Only IPv4 addresses in port forwarding

Fix bug that caused calling of port forwarding setting with IPv6
addresses.
parent f3627973
......@@ -218,11 +218,10 @@ def get_server_public_ip(vm_nics, version=4):
NOTE: 'vm_nics' objects have prefetched the ips
"""
for version in [4, 6]:
for nic in vm_nics:
for ip in nic.ips.all():
if ip.ipversion == version and ip.public:
return ip
for nic in vm_nics:
for ip in nic.ips.all():
if ip.ipversion == version and ip.public:
return ip
return None
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment