From d03fa08aba048846edba3a46f0a709ad1fc4820b Mon Sep 17 00:00:00 2001 From: Prateek Arora Date: Tue, 2 May 2017 07:53:40 -0400 Subject: [PATCH] Add new parameter in place of deprecated one The allow_tenant_isolation parameter has been replaced by use_dynamic_credentials. As such added the parameter and removed the old one. The default location from where tempest expects to pick up the file containing credentials is also added in the patch. The file location is only added when the file is being used. Change-Id: I2e2ec3bcc88570a55cf97bd4b74278970ffa0564 --- config_tempest/config_tempest.py | 6 ++++-- config_tempest/tests/base.py | 4 ++-- config_tempest/tests/test_config_tempest.py | 3 +++ ...enant-isolation-with-dynamic-creds-e79e46c03851ff1c.yaml | 6 ++++++ 4 files changed, 15 insertions(+), 4 deletions(-) create mode 100644 releasenotes/notes/replace-tenant-isolation-with-dynamic-creds-e79e46c03851ff1c.yaml diff --git a/config_tempest/config_tempest.py b/config_tempest/config_tempest.py index 9127a709..4c9f5918 100755 --- a/config_tempest/config_tempest.py +++ b/config_tempest/config_tempest.py @@ -161,9 +161,11 @@ def main(): # To maintain backward compatibility # Moved to auth conf.set("identity", "admin_password", "") - conf.set("auth", "allow_tenant_isolation", "False") + conf.set("auth", "use_dynamic_credentials", "False") if args.use_test_accounts: - conf.set("auth", "allow_tenant_isolation", "True") + # new way for running using accounts file + conf.set("auth", "use_dynamic_credentials", "False") + conf.set("auth", "test_accounts_file", "etc/accounts.yaml") clients = ClientManager(conf, not args.non_admin, args) swift_discover = conf.get_defaulted('object-storage-feature-enabled', 'discoverability') diff --git a/config_tempest/tests/base.py b/config_tempest/tests/base.py index 2875428c..9060f3ca 100644 --- a/config_tempest/tests/base.py +++ b/config_tempest/tests/base.py @@ -41,7 +41,7 @@ class BaseConfigTempestTest(base.BaseTestCase): conf.set("identity", "admin_username", "admin") conf.set("identity", "admin_tenant_name", "adminTenant") conf.set("identity", "admin_password", "adminPass") - conf.set("auth", "allow_tenant_isolation", "False") + conf.set("auth", "use_dynamic_credentials", "False") return conf def _get_alt_conf(self, V2, V3): @@ -58,7 +58,7 @@ class BaseConfigTempestTest(base.BaseTestCase): conf.set("auth", "admin_username", "admin") conf.set("auth", "admin_project_name", "adminTenant") conf.set("auth", "admin_password", "adminPass") - conf.set("auth", "allow_tenant_isolation", "False") + conf.set("auth", "use_dynamic_credentials", "True") return conf @mock.patch('os_client_config.cloud_config.CloudConfig') diff --git a/config_tempest/tests/test_config_tempest.py b/config_tempest/tests/test_config_tempest.py index 4f3e447c..f5e04ebb 100644 --- a/config_tempest/tests/test_config_tempest.py +++ b/config_tempest/tests/test_config_tempest.py @@ -129,6 +129,9 @@ class TestClientManager(BaseConfigTempestTest): # check if admin tenant id was set admin_tenant_id = self.conf.get("identity", "admin_tenant_id") self.assertEqual(admin_tenant_id, "my_fake_id") + use_dynamic_creds_bool = self.conf.get("auth", + "use_dynamic_credentials") + self.assertEqual(use_dynamic_creds_bool, "True") class TestOsClientConfigSupport(BaseConfigTempestTest): diff --git a/releasenotes/notes/replace-tenant-isolation-with-dynamic-creds-e79e46c03851ff1c.yaml b/releasenotes/notes/replace-tenant-isolation-with-dynamic-creds-e79e46c03851ff1c.yaml new file mode 100644 index 00000000..1fa89398 --- /dev/null +++ b/releasenotes/notes/replace-tenant-isolation-with-dynamic-creds-e79e46c03851ff1c.yaml @@ -0,0 +1,6 @@ +--- +prelude: > + Deprecate allow_tenant_isolation parameter. +deprecations: + - | + Replace allow_tenant_isolation with use_dynamic_credentials