diff options
author | Rob Crittenden <rcritten@redhat.com> | 2008-09-15 18:15:12 -0400 |
---|---|---|
committer | Rob Crittenden <rcritten@redhat.com> | 2008-09-17 20:56:08 -0400 |
commit | f736253b93bbb58000ae4ca0de63f9d6340f570a (patch) | |
tree | 97d5ba6212a4b296d4b1ac2c9a82f80400d2711e /ipa-server/ipaserver | |
parent | aa8c4a53bf149aa0e9adfdf2058925eb71cca61b (diff) | |
download | freeipa-f736253b93bbb58000ae4ca0de63f9d6340f570a.tar.gz freeipa-f736253b93bbb58000ae4ca0de63f9d6340f570a.tar.xz freeipa-f736253b93bbb58000ae4ca0de63f9d6340f570a.zip |
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 <password_file>, so we
don't have to pass it on the command-line.
Diffstat (limited to 'ipa-server/ipaserver')
-rw-r--r-- | ipa-server/ipaserver/dsinstance.py | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/ipa-server/ipaserver/dsinstance.py b/ipa-server/ipaserver/dsinstance.py index d313b4ed2..5c7cadd55 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") |