summaryrefslogtreecommitdiffstats
path: root/install/tools/ipa-server-install
diff options
context:
space:
mode:
Diffstat (limited to 'install/tools/ipa-server-install')
-rwxr-xr-xinstall/tools/ipa-server-install44
1 files changed, 22 insertions, 22 deletions
diff --git a/install/tools/ipa-server-install b/install/tools/ipa-server-install
index 961c86c13..26bb8b4b4 100755
--- a/install/tools/ipa-server-install
+++ b/install/tools/ipa-server-install
@@ -29,7 +29,6 @@
import sys
import os
import errno
-import logging
import grp
import subprocess
import signal
@@ -63,6 +62,7 @@ from ipalib.dn import DN
from ipalib.x509 import load_certificate_from_file, load_certificate_chain_from_file
from ipalib.constants import DNS_ZONE_REFRESH
from ipapython import services as ipaservices
+from ipapython.ipa_log_manager import *
pw_name = None
uninstalling = False
@@ -440,7 +440,7 @@ def uninstall():
try:
(stdout, stderr, rc) = run(["/usr/sbin/ipa-client-install", "--on-master", "--unattended", "--uninstall"], raiseonerr=False)
if rc not in [0,2]:
- logging.debug("ipa-client-install returned %d" % rc)
+ root_logger.debug("ipa-client-install returned %d" % rc)
raise RuntimeError(stdout)
except Exception, e:
rv = 1
@@ -472,10 +472,10 @@ def uninstall():
try:
ipautil.run(["/usr/sbin/groupdel", dsinstance.DS_GROUP])
except ipautil.CalledProcessError, e:
- logging.critical("failed to delete group %s" % e)
+ root_logger.critical("failed to delete group %s" % e)
rv = 1
except KeyError:
- logging.info("Group %s already removed", dsinstance.DS_GROUP)
+ root_logger.info("Group %s already removed", dsinstance.DS_GROUP)
ipaservices.knownservices.ipa.disable()
@@ -488,16 +488,16 @@ def uninstall():
print >>sys.stderr, "Failed to set this machine hostname back to %s (%s)." % (old_hostname, str(e))
if fstore.has_files():
- logging.error('Some files have not been restored, see /var/lib/ipa/sysrestore/sysrestore.index')
+ root_logger.error('Some files have not been restored, see /var/lib/ipa/sysrestore/sysrestore.index')
has_state = False
for module in IPA_MODULES: # from installutils
if sstore.has_state(module):
- logging.error('Some installation state for %s has not been restored, see /var/lib/ipa/sysrestore/sysrestore.state' % module)
+ root_logger.error('Some installation state for %s has not been restored, see /var/lib/ipa/sysrestore/sysrestore.state' % module)
has_state = True
rv = 1
if has_state:
- logging.warn('Some installation state has not been restored.\nThis will cause re-installation to fail.\nIt should be safe to remove /var/lib/ipa/sysrestore.state but it may\nmean your system hasn\'t be restored to its pre-installation state.')
+ root_logger.warning('Some installation state has not been restored.\nThis will cause re-installation to fail.\nIt should be safe to remove /var/lib/ipa/sysrestore.state but it may\nmean your system hasn\'t be restored to its pre-installation state.')
return rv
@@ -510,7 +510,7 @@ def set_subject_in_config(realm_name, dm_password, suffix, subject_base):
conn = ldap2(shared_instance=False, ldap_uri=ldapuri, base_dn=suffix)
conn.connect(bind_dn='cn=directory manager', bind_pw=dm_password)
except errors.ExecutionError, e:
- logging.critical("Could not connect to the Directory Server on %s" % realm_name)
+ root_logger.critical("Could not connect to the Directory Server on %s" % realm_name)
raise e
(dn, entry_attrs) = conn.get_ipa_config()
if 'ipacertificatesubjectbase' not in entry_attrs:
@@ -534,9 +534,9 @@ def main():
if options.uninstall:
uninstalling = True
- standard_logging_setup("/var/log/ipaserver-uninstall.log", options.debug)
+ standard_logging_setup("/var/log/ipaserver-uninstall.log", debug=options.debug)
else:
- standard_logging_setup("/var/log/ipaserver-install.log", options.debug)
+ standard_logging_setup("/var/log/ipaserver-install.log", debug=options.debug)
print "\nThe log file for this installation can be found in /var/log/ipaserver-install.log"
if not options.external_ca and not options.external_cert_file and is_ipa_configured():
sys.exit("IPA server is already configured on this system.\n"
@@ -547,8 +547,8 @@ def main():
sys.exit("IPA client is already configured on this system.\n"
+ "Please uninstall it first before configuring the IPA server.")
- logging.debug('%s was invoked with options: %s' % (sys.argv[0], safe_options))
- logging.debug("missing options might be asked for interactively later\n")
+ root_logger.debug('%s was invoked with options: %s' % (sys.argv[0], safe_options))
+ root_logger.debug("missing options might be asked for interactively later\n")
global fstore
fstore = sysrestore.FileStore('/var/lib/ipa/sysrestore')
@@ -706,7 +706,7 @@ def main():
sys.exit(str(e) + "\n")
host_name = host_name.lower()
- logging.debug("will use host_name: %s\n" % host_name)
+ root_logger.debug("will use host_name: %s\n" % host_name)
system_hostname = get_fqdn()
if host_name != system_hostname:
@@ -719,7 +719,7 @@ def main():
if not options.domain_name:
domain_name = read_domain_name(host_name[host_name.find(".")+1:], options.unattended)
- logging.debug("read domain_name: %s\n" % domain_name)
+ root_logger.debug("read domain_name: %s\n" % domain_name)
else:
domain_name = options.domain_name
@@ -751,7 +751,7 @@ def main():
if ip is None:
ip = read_ip_address(host_name, fstore)
- logging.debug("read ip_address: %s\n" % str(ip))
+ root_logger.debug("read ip_address: %s\n" % str(ip))
ip_address = str(ip)
@@ -785,7 +785,7 @@ def main():
if not options.realm_name:
realm_name = read_realm_name(domain_name, options.unattended)
- logging.debug("read realm_name: %s\n" % realm_name)
+ root_logger.debug("read realm_name: %s\n" % realm_name)
else:
realm_name = options.realm_name.upper()
@@ -831,7 +831,7 @@ def main():
print "Using reverse zone %s" % reverse_zone
else:
dns_forwarders = ()
- logging.debug("will use dns_forwarders: %s\n" % str(dns_forwarders))
+ root_logger.debug("will use dns_forwarders: %s\n" % str(dns_forwarders))
# Create the management framework config file and finalize api
target_fname = '/etc/ipa/default.conf'
@@ -862,7 +862,7 @@ def main():
print ""
if host_name != system_hostname:
- logging.debug("Chosen hostname (%s) differs from system hostname (%s) - change it" \
+ root_logger.debug("Chosen hostname (%s) differs from system hostname (%s) - change it" \
% (host_name, system_hostname))
# configure /etc/sysconfig/network to contain the custom hostname
ipaservices.backup_and_replace_hostname(fstore, sstore, host_name)
@@ -870,16 +870,16 @@ def main():
# Create DS group if it doesn't exist yet
try:
grp.getgrnam(dsinstance.DS_GROUP)
- logging.debug("ds group %s exists" % dsinstance.DS_GROUP)
+ root_logger.debug("ds group %s exists" % dsinstance.DS_GROUP)
group_exists = True
except KeyError:
group_exists = False
args = ["/usr/sbin/groupadd", "-r", dsinstance.DS_GROUP]
try:
ipautil.run(args)
- logging.debug("done adding DS group")
+ root_logger.debug("done adding DS group")
except ipautil.CalledProcessError, e:
- logging.critical("failed to add DS group: %s" % e)
+ root_logger.critical("failed to add DS group: %s" % e)
sstore.backup_state("install", "group_exists", group_exists)
# Configure ntpd
@@ -1131,7 +1131,7 @@ try:
message = str(e)
for str in traceback.format_tb(sys.exc_info()[2]):
message = message + "\n" + str
- logging.debug(message)
+ root_logger.debug(message)
sys.exit(1)
finally:
if pw_name and ipautil.file_exists(pw_name):