From f736253b93bbb58000ae4ca0de63f9d6340f570a Mon Sep 17 00:00:00 2001 From: Rob Crittenden Date: Mon, 15 Sep 2008 18:15:12 -0400 Subject: Run the LDAP updater at the end of the installation process. Running at the end ensures that /etc/ipa/ipa.conf is created and generally makes it more likely to succeed. Added a new argument to ipa-server-installl, -y , so we don't have to pass it on the command-line. --- ipa-server/ipaserver/dsinstance.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'ipa-server/ipaserver/dsinstance.py') diff --git a/ipa-server/ipaserver/dsinstance.py b/ipa-server/ipaserver/dsinstance.py index d313b4ed..5c7cadd5 100644 --- a/ipa-server/ipaserver/dsinstance.py +++ b/ipa-server/ipaserver/dsinstance.py @@ -304,6 +304,26 @@ class DsInstance(service.Service): def init_memberof(self): 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) + def __add_referint_module(self): self.__ldap_mod("referint-conf.ldif") -- cgit