From: Cédric Ollivier Date: Wed, 18 Nov 2020 15:16:23 +0000 (+0100) Subject: Use EXTERNAL_NETWORK as a fallback if no tenant network X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=09ba0a6fb4913accb82a5fccbb0ca7cf87649ec0;p=functest.git Use EXTERNAL_NETWORK as a fallback if no tenant network It pleases the networking configuration proposed by Airship. Change-Id: I24bc4613557c61db93d543cde730cd872e0176e0 Signed-off-by: Cédric Ollivier (cherry picked from commit 5b96694ec402cede3e0ce3b57fa7e7cff281f179) --- diff --git a/functest/opnfv_tests/openstack/rally/rally.py b/functest/opnfv_tests/openstack/rally/rally.py index e2b0b07bd..3ffec0cfb 100644 --- a/functest/opnfv_tests/openstack/rally/rally.py +++ b/functest/opnfv_tests/openstack/rally/rally.py @@ -130,7 +130,14 @@ class RallyBase(singlevm.VmReady2): if self.network: task_args['netid'] = str(self.network.id) else: - task_args['netid'] = '' + LOGGER.warning( + 'No tenant network created. ' + 'Trying EXTERNAL_NETWORK as a fallback') + if env.get("EXTERNAL_NETWORK"): + network = self.cloud.get_network(env.get("EXTERNAL_NETWORK")) + task_args['netid'] = str(network.id) if network else '' + else: + task_args['netid'] = '' return task_args