From 5c8573c7e51ff8aa7d349c03e1339bb88d197585 Mon Sep 17 00:00:00 2001 From: =?utf8?q?C=C3=A9dric=20Ollivier?= Date: Sun, 23 Sep 2018 11:25:26 +0200 Subject: [PATCH] Protect vs former OS env vars MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit rally_jobs is failing vs APEX which still sets OS_TENANT [1]. [1] https://build.opnfv.org/ci/view/functest/job/functest-apex-baremetal-daily-master/324/console Change-Id: I672bfa93b37b1b773ea7d20fdd91bea0ff14b79f Signed-off-by: Cédric Ollivier (cherry picked from commit 83e0e6836d7f5e18eb4eb8c9d28b4e6980b790c2) --- functest/opnfv_tests/openstack/rally/rally.py | 5 +++++ functest/opnfv_tests/openstack/tempest/tempest.py | 5 +++++ 2 files changed, 10 insertions(+) diff --git a/functest/opnfv_tests/openstack/rally/rally.py b/functest/opnfv_tests/openstack/rally/rally.py index e5cdf9fe8..ac44de118 100644 --- a/functest/opnfv_tests/openstack/rally/rally.py +++ b/functest/opnfv_tests/openstack/rally/rally.py @@ -533,6 +533,11 @@ class RallyBase(singlevm.VmReady2): OS_PROJECT_NAME=self.project.project.name, OS_PROJECT_ID=self.project.project.id, OS_PASSWORD=self.project.password) + try: + del environ['OS_TENANT_NAME'] + del environ['OS_TENANT_ID'] + except Exception: # pylint: disable=broad-except + pass conf_utils.create_rally_deployment(environ=environ) self.prepare_run() self.run_tests() diff --git a/functest/opnfv_tests/openstack/tempest/tempest.py b/functest/opnfv_tests/openstack/tempest/tempest.py index d903411ab..73bb443ab 100644 --- a/functest/opnfv_tests/openstack/tempest/tempest.py +++ b/functest/opnfv_tests/openstack/tempest/tempest.py @@ -64,6 +64,11 @@ class TempestCommon(singlevm.VmReady2): OS_PROJECT_NAME=self.project.project.name, OS_PROJECT_ID=self.project.project.id, OS_PASSWORD=self.project.password) + try: + del environ['OS_TENANT_NAME'] + del environ['OS_TENANT_ID'] + except Exception: # pylint: disable=broad-except + pass self.deployment_id = conf_utils.create_rally_deployment( environ=environ) if not self.deployment_id: -- 2.16.6