summaryrefslogtreecommitdiffstats
path: root/ipaserver/plugins
diff options
context:
space:
mode:
authorPavel Zuna <pzuna@redhat.com>2010-03-24 15:51:31 +0100
committerRob Crittenden <rcritten@redhat.com>2010-04-19 11:27:10 -0400
commit3620135ec97c156b84a310cd423d5df52732b3f8 (patch)
tree665eb48ad333da90acf0313e0005877954e4b9f7 /ipaserver/plugins
parentcc336cf9c17283684df7b850e010d669122126a5 (diff)
downloadfreeipa-3620135ec97c156b84a310cd423d5df52732b3f8.tar.gz
freeipa-3620135ec97c156b84a310cd423d5df52732b3f8.tar.xz
freeipa-3620135ec97c156b84a310cd423d5df52732b3f8.zip
Use ldap2 instead of legacy LDAP code from v1 in installer scripts.
Diffstat (limited to 'ipaserver/plugins')
-rw-r--r--ipaserver/plugins/ldap2.py22
1 files changed, 9 insertions, 13 deletions
diff --git a/ipaserver/plugins/ldap2.py b/ipaserver/plugins/ldap2.py
index 84a91780f..33b85f352 100644
--- a/ipaserver/plugins/ldap2.py
+++ b/ipaserver/plugins/ldap2.py
@@ -219,19 +219,15 @@ class ldap2(CrudBackend, Encoder):
self.encoder_settings.decode_dict_vals_table = self._SYNTAX_MAPPING
self.encoder_settings.decode_dict_vals_table_keygen = get_syntax
self.encoder_settings.decode_postprocessor = lambda x: string.lower(x)
- if ldap_uri is None:
- self.ldap_uri = api.env.ldap_uri
- else:
- self.ldap_uri = ldap_uri
- if base_dn is None:
- self.base_dn = api.env.basedn
- else:
- self.base_dn = base_dn
- if schema is None:
- self.schema = _schema
- else:
- self.schema = schema
-
+ try:
+ self.ldap_uri = ldap_uri or api.env.ldap_uri
+ except AttributeError:
+ self.ldap_uri = 'ldap://example.com'
+ try:
+ self.base_dn = base_dn or api.env.basedn
+ except AttributeError:
+ self.base_dn = ''
+ self.schema = schema or _schema
def __del__(self):
if self.isconnected():