Browse Source

Workaround multiple private network ports

In the case where there are multiple private networks, don't actively
throw an error. Instead, just grab the first port and attach NAT to it.
That's not completely correct, so a follow up patch is forthcoming that
will add support to os-client-config for such a configuration value.
However, in the mean time, just grab one, because why not.

Change-Id: Ib3a49c0efc72a6de0bdd84c3fe1f34cc5f553a8c
changes/45/299645/2
Monty Taylor 5 years ago
parent
commit
e43625d300
  1. 9
      shade/openstackcloud.py

9
shade/openstackcloud.py

@ -3141,15 +3141,10 @@ class OpenStackCloud(object):
return (None, None)
port = None
if not fixed_address:
if len(ports) > 1:
raise OpenStackCloudException(
"More than one port was found for server {server}"
" and no fixed_address was specified. It is not"
" possible to infer correct behavior. Please specify"
" a fixed_address - or file a bug in shade describing"
" how you think this should work.")
# We're assuming one, because we have no idea what to do with
# more than one.
# TODO(mordred) Fix this for real by allowing a configurable
# NAT destination setting
port = ports[0]
# Select the first available IPv4 address
for address in port.get('fixed_ips', list()):

Loading…
Cancel
Save