From 2ad588de8c658c987869d1e5e7801f5c3623c071 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Ollivier?= Date: Sun, 22 Jul 2018 14:01:00 +0200 Subject: [PATCH] Skip searching network in project if external or shared MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It meets the OpenStack rules: - any router can be connected to an external network. - any VM can be connected to a shared network It completes https://gerrit.opnfv.org/gerrit/59865 which partially skip the lookup. Then CreateRouterSuccessTests passes when the external network is not owned by the user running snaps_smoke. JIRA: SNAPS-320 Change-Id: I2c60363002c6b667f90ff3f5f984eace4fa86c99 Signed-off-by: Cédric Ollivier (cherry picked from commit 821d86248054017ea8ac40b99759df71fa639e3b) --- snaps/config/network.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/snaps/config/network.py b/snaps/config/network.py index 49d1a7a..f55ffa8 100644 --- a/snaps/config/network.py +++ b/snaps/config/network.py @@ -444,7 +444,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 """ @@ -458,7 +457,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 network.external): network = neutron_utils.get_network( neutron, keystone, network_name=self.network_name, project_name=project_name) -- 2.16.6