Protect vs former OS env vars 41/62841/1
authorCédric Ollivier <cedric.ollivier@orange.com>
Sun, 23 Sep 2018 09:25:26 +0000 (11:25 +0200)
committerCédric Ollivier <cedric.ollivier@orange.com>
Sun, 23 Sep 2018 09:27:50 +0000 (11:27 +0200)
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 <cedric.ollivier@orange.com>
(cherry picked from commit 83e0e6836d7f5e18eb4eb8c9d28b4e6980b790c2)

functest/opnfv_tests/openstack/rally/rally.py
functest/opnfv_tests/openstack/tempest/tempest.py

index e5cdf9f..ac44de1 100644 (file)
@@ -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()
index d903411..73bb443 100644 (file)
@@ -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: