py3: urlfetch: use "file://" prefix with filenames

with py3 urlopen used internally with pyldap doesn't work with raw
filepaths without specifying "file://" prefix. This works on both
py2/py3

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

Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Reviewed-By: Stanislav Laznicka <slaznick@redhat.com>
This commit is contained in:
Martin Basti 2017-02-13 17:33:21 +01:00
parent b09a941f34
commit c6a57d8091

View File

@ -125,7 +125,8 @@ def update_schema(schema_files, ldapi=False, dm_password=None,):
for filename in schema_files:
log.debug('Processing schema LDIF file %s', filename)
_dn, new_schema = ldap.schema.subentry.urlfetch(filename)
url = "file://{}".format(filename)
_dn, new_schema = ldap.schema.subentry.urlfetch(url)
for attrname, cls in SCHEMA_ELEMENT_CLASSES:
for oids_set in _get_oid_dependency_order(new_schema, cls):