From bc346357a2205d552e62a351a4d37b3f2398b87e Mon Sep 17 00:00:00 2001 From: Adam Young Date: Thu, 1 Mar 2012 15:46:41 -0500 Subject: LDAP get_user_by_name Required by keystoneclient https://bugs.launchpad.net/keystone/+bug/943567 bug 943567 Change-Id: I5aec63e81262ad6f3b2e5a984841d8d6bdfa8da5 --- keystone/identity/backends/ldap/core.py | 6 ++++++ tests/_ldap_livetest.py | 3 --- tests/test_backend_ldap.py | 3 --- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/keystone/identity/backends/ldap/core.py b/keystone/identity/backends/ldap/core.py index 3138720f..5d95d500 100644 --- a/keystone/identity/backends/ldap/core.py +++ b/keystone/identity/backends/ldap/core.py @@ -105,6 +105,12 @@ class Identity(identity.Driver): return None return _filter_user(user_ref) + def get_user_by_name(self, user_name): + user_ref = self.user.get_by_name(user_name) + if not user_ref: + return None + return _filter_user(user_ref) + def get_metadata(self, user_id, tenant_id): if not self.get_tenant(tenant_id): return None diff --git a/tests/_ldap_livetest.py b/tests/_ldap_livetest.py index 167e0e51..803d13e9 100644 --- a/tests/_ldap_livetest.py +++ b/tests/_ldap_livetest.py @@ -56,6 +56,3 @@ class LDAPIdentity(test.TestCase, test_backend.IdentityTests): def tearDown(self): test.TestCase.tearDown(self) - - def test_get_user_by_name(self): - raise nose.exc.SkipTest('not implemented in ldap yet') diff --git a/tests/test_backend_ldap.py b/tests/test_backend_ldap.py index b989bcef..5300be83 100644 --- a/tests/test_backend_ldap.py +++ b/tests/test_backend_ldap.py @@ -31,6 +31,3 @@ class LDAPIdentity(test.TestCase, test_backend.IdentityTests): def tearDown(self): test.TestCase.tearDown(self) - - def test_get_user_by_name(self): - raise nose.exc.SkipTest('not implemented in ldap yet') -- cgit