Update identity v2 users_client methods name
Makes some methods name of identity v2 users_client consistent
with other service clients.
Partially implements blueprint consistent-service-method-names
Change-Id: I4dff7b1b71e1b4f8bfc1da302fd7d06a430496c9
diff --git a/tempest/api/identity/base.py b/tempest/api/identity/base.py
index bc1b158..e6a22b0 100644
--- a/tempest/api/identity/base.py
+++ b/tempest/api/identity/base.py
@@ -29,7 +29,7 @@
@classmethod
def disable_user(cls, user_name):
user = cls.get_user_by_name(user_name)
- cls.users_client.enable_disable_user(user['id'], enabled=False)
+ cls.users_client.update_user_enabled(user['id'], enabled=False)
@classmethod
def disable_tenant(cls, tenant_name):
diff --git a/tempest/api/identity/v2/test_ec2_credentials.py b/tempest/api/identity/v2/test_ec2_credentials.py
index 5902196..3c379f0 100644
--- a/tempest/api/identity/v2/test_ec2_credentials.py
+++ b/tempest/api/identity/v2/test_ec2_credentials.py
@@ -33,14 +33,14 @@
cls.creds = cls.os.credentials
@test.idempotent_id('b580fab9-7ae9-46e8-8138-417260cb6f9f')
- def test_create_ec2_credentials(self):
- """Create user ec2 credentials."""
- resp = self.non_admin_users_client.create_user_ec2_credentials(
+ def test_create_ec2_credential(self):
+ """Create user ec2 credential."""
+ resp = self.non_admin_users_client.create_user_ec2_credential(
self.creds.user_id,
tenant_id=self.creds.tenant_id)["credential"]
access = resp['access']
self.addCleanup(
- self.non_admin_users_client.delete_user_ec2_credentials,
+ self.non_admin_users_client.delete_user_ec2_credential,
self.creds.user_id, access)
self.assertNotEmpty(resp['access'])
self.assertNotEmpty(resp['secret'])
@@ -53,21 +53,21 @@
created_creds = []
fetched_creds = []
# create first ec2 credentials
- creds1 = self.non_admin_users_client.create_user_ec2_credentials(
+ creds1 = self.non_admin_users_client.create_user_ec2_credential(
self.creds.user_id,
tenant_id=self.creds.tenant_id)["credential"]
created_creds.append(creds1['access'])
# create second ec2 credentials
- creds2 = self.non_admin_users_client.create_user_ec2_credentials(
+ creds2 = self.non_admin_users_client.create_user_ec2_credential(
self.creds.user_id,
tenant_id=self.creds.tenant_id)["credential"]
created_creds.append(creds2['access'])
# add credentials to be cleaned up
self.addCleanup(
- self.non_admin_users_client.delete_user_ec2_credentials,
+ self.non_admin_users_client.delete_user_ec2_credential,
self.creds.user_id, creds1['access'])
self.addCleanup(
- self.non_admin_users_client.delete_user_ec2_credentials,
+ self.non_admin_users_client.delete_user_ec2_credential,
self.creds.user_id, creds2['access'])
# get the list of user ec2 credentials
resp = self.non_admin_users_client.list_user_ec2_credentials(
@@ -81,32 +81,32 @@
', '.join(cred for cred in missing))
@test.idempotent_id('cb284075-b613-440d-83ca-fe0b33b3c2b8')
- def test_show_ec2_credentials(self):
- """Get the definite user ec2 credentials."""
- resp = self.non_admin_users_client.create_user_ec2_credentials(
+ def test_show_ec2_credential(self):
+ """Get the definite user ec2 credential."""
+ resp = self.non_admin_users_client.create_user_ec2_credential(
self.creds.user_id,
tenant_id=self.creds.tenant_id)["credential"]
self.addCleanup(
- self.non_admin_users_client.delete_user_ec2_credentials,
+ self.non_admin_users_client.delete_user_ec2_credential,
self.creds.user_id, resp['access'])
- ec2_creds = self.non_admin_users_client.show_user_ec2_credentials(
+ ec2_creds = self.non_admin_users_client.show_user_ec2_credential(
self.creds.user_id, resp['access']
)["credential"]
for key in ['access', 'secret', 'user_id', 'tenant_id']:
self.assertEqual(ec2_creds[key], resp[key])
@test.idempotent_id('6aba0d4c-b76b-4e46-aa42-add79bc1551d')
- def test_delete_ec2_credentials(self):
- """Delete user ec2 credentials."""
- resp = self.non_admin_users_client.create_user_ec2_credentials(
+ def test_delete_ec2_credential(self):
+ """Delete user ec2 credential."""
+ resp = self.non_admin_users_client.create_user_ec2_credential(
self.creds.user_id,
tenant_id=self.creds.tenant_id)["credential"]
access = resp['access']
- self.non_admin_users_client.delete_user_ec2_credentials(
+ self.non_admin_users_client.delete_user_ec2_credential(
self.creds.user_id, access)
self.assertRaises(
lib_exc.NotFound,
- self.non_admin_users_client.show_user_ec2_credentials,
+ self.non_admin_users_client.show_user_ec2_credential,
self.creds.user_id,
access)
diff --git a/tempest/services/identity/v2/json/users_client.py b/tempest/services/identity/v2/json/users_client.py
index 1048840..4ea17f9 100644
--- a/tempest/services/identity/v2/json/users_client.py
+++ b/tempest/services/identity/v2/json/users_client.py
@@ -78,7 +78,7 @@
body = json.loads(body)
return rest_client.ResponseBody(resp, body)
- def enable_disable_user(self, user_id, **kwargs):
+ def update_user_enabled(self, user_id, **kwargs):
"""Enables or disables a user.
Available params: see http://developer.openstack.org/
@@ -121,7 +121,7 @@
body = json.loads(body)
return rest_client.ResponseBody(resp, body)
- def create_user_ec2_credentials(self, user_id, **kwargs):
+ def create_user_ec2_credential(self, user_id, **kwargs):
# TODO(piyush): Current api-site doesn't contain this API description.
# After fixing the api-site, we need to fix here also for putting the
# link to api-site.
@@ -132,7 +132,7 @@
body = json.loads(body)
return rest_client.ResponseBody(resp, body)
- def delete_user_ec2_credentials(self, user_id, access):
+ def delete_user_ec2_credential(self, user_id, access):
resp, body = self.delete('/users/%s/credentials/OS-EC2/%s' %
(user_id, access))
self.expected_success(204, resp.status)
@@ -144,7 +144,7 @@
body = json.loads(body)
return rest_client.ResponseBody(resp, body)
- def show_user_ec2_credentials(self, user_id, access):
+ def show_user_ec2_credential(self, user_id, access):
resp, body = self.get('/users/%s/credentials/OS-EC2/%s' %
(user_id, access))
self.expected_success(200, resp.status)