diff options
author | Rob Crittenden <rcritten@redhat.com> | 2011-05-23 15:07:03 -0400 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2011-05-30 09:16:30 +0200 |
commit | 868d4e734ed0f22221f25a1067fbf57141b64c21 (patch) | |
tree | a61048aa525c0dcc08d4fdbf8f138f17021ff01a /ipalib | |
parent | 6304d9173c16e082d6844b329987680b85086cb7 (diff) | |
download | freeipa-868d4e734ed0f22221f25a1067fbf57141b64c21.tar.gz freeipa-868d4e734ed0f22221f25a1067fbf57141b64c21.tar.xz freeipa-868d4e734ed0f22221f25a1067fbf57141b64c21.zip |
Do a lazy retrieval of the LDAP schema rather than at module load.
Attempt to retrieve the schema the first time it is needed rather than
when Apache is started. A global copy is cached for future requests
for performance reasons.
The schema will be retrieved once per Apache child process.
ticket 583
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/plugins/baseldap.py | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py index 053a0a5a3..3908dfe3e 100644 --- a/ipalib/plugins/baseldap.py +++ b/ipalib/plugins/baseldap.py @@ -600,6 +600,7 @@ class LDAPCreate(CallbackInterface, crud.Create): ) _check_single_value_attrs(self.params, entry_attrs) + ldap.get_schema() _check_limit_object_class(self.api.Backend.ldap2.schema.attribute_types(self.obj.limit_object_classes), entry_attrs.keys(), allow_only=True) _check_limit_object_class(self.api.Backend.ldap2.schema.attribute_types(self.obj.disallow_object_classes), entry_attrs.keys(), allow_only=False) @@ -882,6 +883,7 @@ class LDAPUpdate(LDAPQuery, crud.Update): _check_single_value_attrs(self.params, entry_attrs) _check_empty_attrs(self.obj.params, entry_attrs) + ldap.get_schema() _check_limit_object_class(self.api.Backend.ldap2.schema.attribute_types(self.obj.limit_object_classes), entry_attrs.keys(), allow_only=True) _check_limit_object_class(self.api.Backend.ldap2.schema.attribute_types(self.obj.disallow_object_classes), entry_attrs.keys(), allow_only=False) |