From e43625d30025a11762e1cdd9ff6973ac3ec28db6 Mon Sep 17 00:00:00 2001 From: Monty Taylor Date: Wed, 30 Mar 2016 15:18:35 -0700 Subject: [PATCH] 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 --- shade/openstackcloud.py | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/shade/openstackcloud.py b/shade/openstackcloud.py index fcf631b3c..6cfebd4c1 100644 --- a/shade/openstackcloud.py +++ b/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()):