py3: fix regression in schemaupdate

The python-ldap classes that process schema definitions require a
unicode string, not a byte string.  A recent py3 compatibility fix
(d89de4219d) changed the constructor
argument to a unicode string to dispel a warning, but this broke
schema update.  Change it back to a bytestring.

Part of: https://fedorahosted.org/freeipa/ticket/4985

Reviewed-By: Martin Basti <mbasti@redhat.com>
This commit is contained in:
Fraser Tweedale 2017-06-02 12:49:45 +10:00 committed by Martin Basti
parent 48b7e83511
commit 89eb162fcd

View File

@ -119,7 +119,7 @@ def update_schema(schema_files, ldapi=False, dm_password=None,):
# The exact representation the DS gives us for each OID
# (for debug logging)
old_entries_by_oid = {cls(attr.decode('utf-8')).oid: attr.decode('utf-8')
old_entries_by_oid = {cls(attr).oid: attr.decode('utf-8')
for (attrname, cls) in SCHEMA_ELEMENT_CLASSES
for attr in schema_entry[attrname]}