Browse Source

Merge "Fix python3 compatibility on LDAP search DN from id" into stable/rocky

stable/rocky
Zuul 2 weeks ago
parent
commit
9bb6779fbc
1 changed files with 2 additions and 3 deletions
  1. 2
    3
      keystone/identity/backends/ldap/common.py

+ 2
- 3
keystone/identity/backends/ldap/common.py View File

@@ -1296,9 +1296,8 @@ class BaseLdap(object):
1296 1296
     def _dn_to_id(self, dn):
1297 1297
         # Check if the naming attribute in the DN is the same as keystone's
1298 1298
         # configured 'id' attribute'.  If so, extract the ID value from the DN
1299
-        if self.id_attr == utf8_decode(
1300
-                ldap.dn.str2dn(utf8_encode(dn))[0][0][0].lower()):
1301
-            return utf8_decode(ldap.dn.str2dn(utf8_encode(dn))[0][0][1])
1299
+        if self.id_attr == ldap.dn.str2dn(dn)[0][0][0].lower():
1300
+            return ldap.dn.str2dn(dn)[0][0][1]
1302 1301
         else:
1303 1302
             # The 'ID' attribute is NOT in the DN, so we need to perform an
1304 1303
             # LDAP search to look it up from the user entry itself.

Loading…
Cancel
Save