From d615e45a8f99af25086aef03ae8b724be630d48a Mon Sep 17 00:00:00 2001 From: Martin Kosek Date: Apr 28 2011 08:02:29 +0000 Subject: Log temporary files in ipa-client-install This patch adds logging of temporary files (Kerberos configuration, nsupdate commands) that may be very useful for debugging purposes. https://fedorahosted.org/freeipa/ticket/1093 https://fedorahosted.org/freeipa/ticket/1094 --- diff --git a/ipa-client/ipa-install/ipa-client-install b/ipa-client/ipa-install/ipa-client-install index ca96e86..c409fe7 100755 --- a/ipa-client/ipa-install/ipa-client-install +++ b/ipa-client/ipa-install/ipa-client-install @@ -477,6 +477,9 @@ def configure_krb5_conf(fstore, cli_basedn, cli_realm, cli_domain, cli_server, d appopts = [{'name':'pam', 'type':'subsection', 'value':pamopts}] opts.append({'name':'appdefaults', 'type':'section', 'value':appopts}) + logging.debug("Writing Kerberos configuration to %s:\n%s" + % (filename, krbconf.dump(opts))) + krbconf.newConf(filename, opts); return 0 @@ -616,6 +619,10 @@ def update_dns(server, hostname): return update_txt = ipautil.template_str(template, sub_dict) + + logging.debug("Writing nsupdate commands to %s:\n%s" + % (UPDATE_FILE, update_txt)) + update_fd = file(UPDATE_FILE, "w") update_fd.write(update_txt) update_fd.flush() @@ -628,7 +635,7 @@ def update_dns(server, hostname): print >>sys.stderr, "Failed to obtain host TGT." try: - ipautil.run(['/usr/bin/nsupdate', '-g', "/etc/ipa/.dns_update.txt"], + ipautil.run(['/usr/bin/nsupdate', '-g', UPDATE_FILE], env={'KRB5CCNAME':CCACHE_FILE}) print "DNS server record set to: %s -> %s" % (hostname, ip) except CalledProcessError, e: