From a16f53534b20604e37e83bfdbb8037de5252a10e Mon Sep 17 00:00:00 2001 From: Andrey Kurilin Date: Thu, 18 Jan 2018 12:22:08 +0200 Subject: [PATCH] [envs] Remove credentials base rally.deployment.credential.Credential class was a temporary workaround to support multi-platfrom in Rally. It had not be anounced and a better solution was found (spoiler: rally.env.platform.Platform [1][2]). While CredentialBuilder was already removed (see [3]), Credential base left for OpenStack support and some compatibility stuff. Backward compatible logic can be reworked (and it is what this patch do) in such way so we can remove th whole rally.deployment module without breaking anyone. [1] - Ide95c8b1e8e72293c009f4cd5e430e64eb1dd604 [2] - I83369e899a8b8609a8cd1e77b895d3a1ef8ae3e4 [3] - If7bde619f7c2e99248a071ff18b8084553e1bec0 Change-Id: I98d5c2e0113672b9f280d30f5550413a13f032ee --- rally/plugins/openstack/credential.py | 4 +--- rally/plugins/openstack/platforms/existing.py | 3 +++ tests/unit/plugins/openstack/test_credential.py | 5 ++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/rally/plugins/openstack/credential.py b/rally/plugins/openstack/credential.py index 79c4990f..7ebf0da5 100644 --- a/rally/plugins/openstack/credential.py +++ b/rally/plugins/openstack/credential.py @@ -15,14 +15,12 @@ from rally.common import logging from rally import consts -from rally.deployment import credential from rally.plugins.openstack import osclients LOG = logging.getLogger(__file__) -@credential.configure("openstack") -class OpenStackCredential(credential.Credential): +class OpenStackCredential(object): """Credential for OpenStack.""" def __init__(self, auth_url, username, password, tenant_name=None, diff --git a/rally/plugins/openstack/platforms/existing.py b/rally/plugins/openstack/platforms/existing.py index 6f0fa7bc..123a11bb 100644 --- a/rally/plugins/openstack/platforms/existing.py +++ b/rally/plugins/openstack/platforms/existing.py @@ -173,3 +173,6 @@ class OpenStack(platform.Platform): "services": osclients.Clients(active_user).list_services() } } + + def _get_validation_context(self): + return {"users@openstack": {}} diff --git a/tests/unit/plugins/openstack/test_credential.py b/tests/unit/plugins/openstack/test_credential.py index b6bdc51c..c69f6c82 100644 --- a/tests/unit/plugins/openstack/test_credential.py +++ b/tests/unit/plugins/openstack/test_credential.py @@ -16,7 +16,7 @@ import mock from rally import consts -from rally.deployment import credential +from rally.plugins.openstack import credential from tests.unit import test @@ -24,8 +24,7 @@ class OpenStackCredentialTestCase(test.TestCase): def setUp(self): super(OpenStackCredentialTestCase, self).setUp() - cred_cls = credential.get("openstack") - self.credential = cred_cls( + self.credential = credential.OpenStackCredential( "foo_url", "foo_user", "foo_password", tenant_name="foo_tenant", permission=consts.EndpointPermission.ADMIN)