summaryrefslogtreecommitdiffstats
path: root/ipaserver
diff options
context:
space:
mode:
authorSumit Bose <sbose@redhat.com>2012-10-04 10:15:40 +0200
committerRob Crittenden <rcritten@redhat.com>2012-10-04 22:15:36 -0400
commit0d82862066c674da8927c41e33ce17d2eae713e0 (patch)
tree56c04e12816e18edb20c8e51856de33539e02313 /ipaserver
parent58a99dd5ac5755cb02feb0feecb18d294eaa805c (diff)
downloadfreeipa-0d82862066c674da8927c41e33ce17d2eae713e0.tar.gz
freeipa-0d82862066c674da8927c41e33ce17d2eae713e0.tar.xz
freeipa-0d82862066c674da8927c41e33ce17d2eae713e0.zip
Avoid ldapmodify error messages during ipa-adtrust-install
Fixes https://fedorahosted.org/freeipa/ticket/3012
Diffstat (limited to 'ipaserver')
-rw-r--r--ipaserver/install/adtrustinstance.py47
1 files changed, 34 insertions, 13 deletions
diff --git a/ipaserver/install/adtrustinstance.py b/ipaserver/install/adtrustinstance.py
index 1a92b2885..85be341b8 100644
--- a/ipaserver/install/adtrustinstance.py
+++ b/ipaserver/install/adtrustinstance.py
@@ -351,18 +351,37 @@ class ADTRUSTInstance(service.Service):
conf_fd.write('config backend = registry\n')
conf_fd.close()
- def __add_cldap_module(self):
+ def __add_plugin_conf(self, name, plugin_cn, ldif_file):
+ """
+ Add directory server plugin configuration if it not already
+ exists.
+ """
try:
- self._ldap_mod("ipa-cldap-conf.ldif", self.sub_dict)
- except:
- pass
+ plugin_dn = DN(('cn', plugin_cn), ('cn', 'plugins'),
+ ('cn', 'config'))
+ self.admin_conn.getEntry(plugin_dn, ldap.SCOPE_BASE)
+ self.print_msg('%s plugin already configured, nothing to do' % name)
+ except errors.NotFound:
+ try:
+ self._ldap_mod(ldif_file, self.sub_dict)
+ except Exception:
+ pass
+
+ def __add_cldap_module(self):
+ """
+ Add cldap directory server plugin configuration if it not already
+ exists.
+ """
+ self.__add_plugin_conf('CLDAP', 'ipa_cldap', 'ipa-cldap-conf.ldif')
def __add_sidgen_module(self):
- try:
- self._ldap_mod("ipa-sidgen-conf.ldif", self.sub_dict)
- self._ldap_mod("ipa-sidgen-task-conf.ldif", self.sub_dict)
- except Exception:
- pass
+ """
+ Add sidgen directory server plugin configuration and the related task
+ if they not already exist.
+ """
+ self.__add_plugin_conf('Sidgen', 'IPA SIDGEN', 'ipa-sidgen-conf.ldif')
+ self.__add_plugin_conf('Sidgen task', 'ipa-sidgen-task',
+ 'ipa-sidgen-task-conf.ldif')
def __add_sids(self):
"""
@@ -375,10 +394,12 @@ class ADTRUSTInstance(service.Service):
pass
def __add_extdom_module(self):
- try:
- self._ldap_mod("ipa-extdom-extop-conf.ldif", self.sub_dict)
- except:
- pass
+ """
+ Add directory server configuration for the extdom extended operation
+ if it not already exists.
+ """
+ self.__add_plugin_conf('Extdom', 'ipa_extdom_extop',
+ 'ipa-extdom-extop-conf.ldif')
def __write_smb_registry(self):
template = os.path.join(ipautil.SHARE_DIR, "smb.conf.template")