From 00d54a5668cf256ab6eae93cc3098230c43606df Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Mon, 15 Sep 2008 20:51:01 -0400 Subject: Move the bulk of ipa-ldap-updater into a python library. This significantly simplifies the tool and makes it possible to apply updates from the installer without forking off another process. --- ipa-server/ipaserver/dsinstance.py | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) (limited to 'ipa-server/ipaserver/dsinstance.py') diff --git a/ipa-server/ipaserver/dsinstance.py b/ipa-server/ipaserver/dsinstance.py index 5c7cadd5..93cc457a 100644 --- a/ipa-server/ipaserver/dsinstance.py +++ b/ipa-server/ipaserver/dsinstance.py @@ -34,6 +34,7 @@ import service import installutils import certs import ipaldap, ldap +from ipaserver import ldapupdate SERVER_ROOT_64 = "/usr/lib64/dirsrv" SERVER_ROOT_32 = "/usr/lib/dirsrv" @@ -305,24 +306,9 @@ class DsInstance(service.Service): self.__ldap_mod("memberof-task.ldif", self.sub_dict) def apply_updates(self): - """Run the ipa-ldap-updater tool. Needs to be run after the - configuration file /etc/ipa/ipa.conf has been created. - """ - [pw_fd, pw_name] = tempfile.mkstemp() - os.write(pw_fd, self.dm_password) - os.close(pw_fd) - - try: - args = ["/usr/sbin/ipa-ldap-updater", - "-y", pw_name] - try: - ipautil.run(args) - logging.debug("Updates applied") - except ipautil.CalledProcessError, e: - print "Unable to apply updates", e - logging.debug("Unable to apply updates%s" % e) - finally: - os.remove(pw_name) + ld = ldapupdate.LDAPUpdate(dm_password=self.dm_password) + files = ld.get_all_files(ldapupdate.UPDATES_DIR) + ld.update(files) def __add_referint_module(self): self.__ldap_mod("referint-conf.ldif") -- cgit