[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
This commit is contained in:
Andrey Kurilin 2018-01-18 12:22:08 +02:00
parent d5605fd63d
commit a16f53534b
3 changed files with 6 additions and 6 deletions

View File

@ -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,

View File

@ -173,3 +173,6 @@ class OpenStack(platform.Platform):
"services": osclients.Clients(active_user).list_services()
}
}
def _get_validation_context(self):
return {"users@openstack": {}}

View File

@ -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)