From: Steven Hardy Date: Mon, 3 Dec 2012 11:06:56 +0000 (+0000) Subject: heat engine : remove KeystoneClient get_user_by_name X-Git-Tag: 2014.1~1133 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=c44e852103af82edee980e3475dbd41939ab459c;p=openstack-build%2Fheat-build.git heat engine : remove KeystoneClient get_user_by_name Remove get_user_by_name as it's no longer used, and we want to avoid this style of name->id lookup because it requires keystone admin role. Change-Id: I234a235864ac7537df09cae2f07d99ed9d53acd2 Signed-off-by: Steven Hardy --- diff --git a/heat/common/heat_keystoneclient.py b/heat/common/heat_keystoneclient.py index 0db7ffbd..02aaa3bb 100644 --- a/heat/common/heat_keystoneclient.py +++ b/heat/common/heat_keystoneclient.py @@ -86,16 +86,6 @@ class KeystoneClient(object): return user.id - def get_user_by_name(self, username): - """ - Return the ID for the specified username - """ - users = self.client.users.list(tenant_id=self.context.tenant_id) - for u in users: - if u.name == username: - return u.id - return None - def delete_stack_user(self, user_id): user = self.client.users.get(user_id) diff --git a/heat/tests/fakes.py b/heat/tests/fakes.py index 89be718d..38dc6579 100644 --- a/heat/tests/fakes.py +++ b/heat/tests/fakes.py @@ -102,10 +102,6 @@ class FakeKeystoneClient(): def delete_stack_user(self, user_id): self.user_id = None - def get_user_by_name(self, username): - if username == self.username: - return self.user_id - def get_ec2_keypair(self, user_id): if user_id == self.user_id: if not self.creds: