summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRob Crittenden <rcritten@redhat.com>2010-09-08 17:14:38 -0400
committerRob Crittenden <rcritten@redhat.com>2010-09-09 09:05:16 -0400
commit0a47351fd6a72e475f1e61fe1699dd84f008c9c1 (patch)
treeebe130ffa2c32d67b3d7a6dcf7cc4083ffa10cd9
parent0050e2fcd957cd037e25c3ef68322a6204de7450 (diff)
downloadfreeipa.git-0a47351fd6a72e475f1e61fe1699dd84f008c9c1.tar.gz
freeipa.git-0a47351fd6a72e475f1e61fe1699dd84f008c9c1.tar.xz
freeipa.git-0a47351fd6a72e475f1e61fe1699dd84f008c9c1.zip
Allow the schema to be set once an ldap connection is locked.
When making LDAP calls via api.Backend.ldap2 the ldap2 object will already be locked by the api.finalize() call. So the first time that api.Backend.ldap2.connect() is called an error would be thrown that self.schema cannot be set because the object is ReadOnly. This uses the documented procedure for working around this lock. This was preventing the DNS installation to proceed. ticket #188
-rw-r--r--ipaserver/plugins/ldap2.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/ipaserver/plugins/ldap2.py b/ipaserver/plugins/ldap2.py
index d4c02941..cc635b66 100644
--- a/ipaserver/plugins/ldap2.py
+++ b/ipaserver/plugins/ldap2.py
@@ -292,7 +292,9 @@ class ldap2(CrudBackend, Encoder):
_handle_errors(e, **{})
if self.schema is None and _schema is None:
- self.schema = get_schema(self.ldap_uri, conn)
+ # explicitly use setattr here so the schema can be set after
+ # the object is finalized.
+ object.__setattr__(self, 'schema', get_schema(self.ldap_uri, conn))
return conn
def destroy_connection(self):