Added additional check when creating a port on a network for 65/59865/1
authorspisarski <s.pisarski@cablelabs.com>
Mon, 16 Jul 2018 16:57:38 +0000 (10:57 -0600)
committerspisarski <s.pisarski@cablelabs.com>
Mon, 16 Jul 2018 16:57:38 +0000 (10:57 -0600)
the external flag is not True to query the network for the
given project.

JIRA: SNAPS-320

Change-Id: Ie755633520fe30664fc89e9daaea6aa2d14c2e52
Signed-off-by: spisarski <s.pisarski@cablelabs.com>
snaps/config/network.py

index 620640f..ffafbb6 100644 (file)
@@ -449,7 +449,6 @@ class PortConfig(object):
 
         TODO - expand automated testing to exercise all parameters
         :param neutron: the Neutron client
-        :param keystone: the Keystone client
         :param os_creds: the OpenStack credentials
         :return: the dictionary object
         """
@@ -463,7 +462,7 @@ class PortConfig(object):
         try:
             network = neutron_utils.get_network(
                 neutron, keystone, network_name=self.network_name)
-            if network and not network.shared:
+            if network and (not network.shared or not network.external):
                 network = neutron_utils.get_network(
                     neutron, keystone, network_name=self.network_name,
                     project_name=project_name)