From 3f28888f7d4827e22b4780316740b3d6e0fd4b82 Mon Sep 17 00:00:00 2001 From: Ken'ichi Ohmichi Date: Mon, 9 Nov 2015 12:13:40 +0000 Subject: [PATCH] Rename list_users_for_tenant to list_tenant_users This patch renames list_users_for_tenant to list_tenant_users for fitting the other service clients' methods. Partially implements blueprint consistent-service-method-names Change-Id: I9a9cdf14948117befb71bb54865fb8f1b92dbde8 --- tempest/api/identity/admin/v2/test_users.py | 4 ++-- tempest/api/identity/admin/v2/test_users_negative.py | 2 +- tempest/services/identity/v2/json/identity_client.py | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tempest/api/identity/admin/v2/test_users.py b/tempest/api/identity/admin/v2/test_users.py index 81468283fb..6341106ad7 100644 --- a/tempest/api/identity/admin/v2/test_users.py +++ b/tempest/api/identity/admin/v2/test_users.py @@ -146,7 +146,7 @@ class UsersTestJSON(base.BaseIdentityV2AdminTest): user_ids.append(user2['id']) self.data.users.append(user2) # List of users for the respective tenant ID - body = (self.client.list_users_for_tenant(self.data.tenant['id']) + body = (self.client.list_tenant_users(self.data.tenant['id']) ['users']) for i in body: fetched_user_ids.append(i['id']) @@ -182,7 +182,7 @@ class UsersTestJSON(base.BaseIdentityV2AdminTest): second_user['id'], role['id'])['role'] # List of users with roles for the respective tenant ID - body = (self.client.list_users_for_tenant(self.data.tenant['id']) + body = (self.client.list_tenant_users(self.data.tenant['id']) ['users']) for i in body: fetched_user_ids.append(i['id']) diff --git a/tempest/api/identity/admin/v2/test_users_negative.py b/tempest/api/identity/admin/v2/test_users_negative.py index 6d9d84b130..a88053d1a7 100644 --- a/tempest/api/identity/admin/v2/test_users_negative.py +++ b/tempest/api/identity/admin/v2/test_users_negative.py @@ -247,4 +247,4 @@ class UsersNegativeTestJSON(base.BaseIdentityV2AdminTest): # List the users with invalid tenant id for invalid in invalid_id: self.assertRaises(lib_exc.NotFound, - self.client.list_users_for_tenant, invalid) + self.client.list_tenant_users, invalid) diff --git a/tempest/services/identity/v2/json/identity_client.py b/tempest/services/identity/v2/json/identity_client.py index 8f76c74d02..1c1bfaa089 100644 --- a/tempest/services/identity/v2/json/identity_client.py +++ b/tempest/services/identity/v2/json/identity_client.py @@ -213,7 +213,7 @@ class IdentityClient(service_client.ServiceClient): self.expected_success(204, resp.status) return service_client.ResponseBody(resp, body) - def list_users_for_tenant(self, tenant_id): + def list_tenant_users(self, tenant_id): """List users for a Tenant.""" resp, body = self.get('/tenants/%s/users' % tenant_id) self.expected_success(200, resp.status) @@ -221,7 +221,7 @@ class IdentityClient(service_client.ServiceClient): return service_client.ResponseBody(resp, body) def get_user_by_username(self, tenant_id, username): - users = self.list_users_for_tenant(tenant_id)['users'] + users = self.list_tenant_users(tenant_id)['users'] for user in users: if user['name'] == username: return user