[Freeipa-devel] [PATCH] Don't load the LDAP schema during startup

Rob Crittenden rcritten at redhat.com
Tue Feb 22 20:14:56 UTC 2011


Jan Zelený wrote:
> Rob Crittenden<rcritten at redhat.com>  wrote:
>> Jan Zelený wrote:
>>> Loading of the schema is now performed in the first request that requires
>>> it.
>>>
>>> https://fedorahosted.org/freeipa/ticket/583
>>>
>>> Jan
>>
>> We still need to enforce that we get the schema, some low-level
>> functions depend on it. Also, if the UI doesn't get its aciattrs (which
>> are derived from the schema) then nothing will be editable.
>>
>> I'm getting this backtrace if I force no schema by disabling get_schema:
>
> Ok, I'm sending new version, it should handle these exceptions better and the
> operation should fail if it needs the schema and the schema is not available
> for some reason.
>

This breaks the XML-RPC server. I fixed one problem:
--- a/ipaserver/plugins/ldap2.py
+++ b/ipaserver/plugins/ldap2.py
@@ -253,9 +253,10 @@ class ldap2(CrudBackend, Encoder):

      def get_syntax(self, attr, value):
          if not self.schema:
-            self.schema = get_schema(self.ldap_uri, self.conn)
-            if not self.schema:
+            schema = get_schema(self.ldap_uri, self.conn)
+            if not schema:
                  return None
+            object.__setattr__(self, 'schema', schema)
          obj = self.schema.get_obj(_ldap.schema.AttributeType, attr)
          if obj is not None:
              return obj.syntax

But simply things like get_entry() return an InternalError now. I'm not 
sure where you were going by adding this.

rob




More information about the Freeipa-devel mailing list