summaryrefslogtreecommitdiffstats
path: root/install/tools/ipa-replica-install
diff options
context:
space:
mode:
authorJohn Dennis <jdennis@redhat.com>2011-11-15 14:39:31 -0500
committerMartin Kosek <mkosek@redhat.com>2011-11-23 09:36:18 +0100
commit56401c1abe7d4c78650acfcd9bbe8c8edc1dac57 (patch)
treea759f9fb51d4e2e110c55dbecc45f436386ee30f /install/tools/ipa-replica-install
parent730f1228a91ec9c6e575181807da2ab994a38071 (diff)
downloadfreeipa-56401c1abe7d4c78650acfcd9bbe8c8edc1dac57.tar.gz
freeipa-56401c1abe7d4c78650acfcd9bbe8c8edc1dac57.tar.xz
freeipa-56401c1abe7d4c78650acfcd9bbe8c8edc1dac57.zip
ticket 2022 - modify codebase to utilize IPALogManager, obsoletes logging
change default_logger_level to debug in configure_standard_logging add new ipa_log_manager module, move log_mgr there, also export root_logger from log_mgr. change all log_manager imports to ipa_log_manager and change log_manager.root_logger to root_logger. add missing import for parse_log_level()
Diffstat (limited to 'install/tools/ipa-replica-install')
-rwxr-xr-xinstall/tools/ipa-replica-install21
1 files changed, 11 insertions, 10 deletions
diff --git a/install/tools/ipa-replica-install b/install/tools/ipa-replica-install
index 18a6c4a14..fd772e571 100755
--- a/install/tools/ipa-replica-install
+++ b/install/tools/ipa-replica-install
@@ -21,7 +21,7 @@
import sys
import socket
-import os, pwd, traceback, logging, shutil
+import os, pwd, traceback, shutil
import grp
from optparse import OptionGroup
@@ -40,6 +40,7 @@ from ipalib import api, errors, util
from ipapython.config import IPAOptionParser
from ipapython import sysrestore
from ipapython import services as ipaservices
+from ipapython.ipa_log_manager import *
CACERT="/etc/ipa/ca.crt"
REPLICA_INFO_TOP_DIR=None
@@ -265,8 +266,8 @@ def check_bind():
def main():
safe_options, options, filename = parse_options()
- installutils.standard_logging_setup("/var/log/ipareplica-install.log", options.debug)
- logging.debug('%s was invoked with argument "%s" and options: %s' % (sys.argv[0], filename, safe_options))
+ standard_logging_setup("/var/log/ipareplica-install.log", debug=options.debug)
+ root_logger.debug('%s was invoked with argument "%s" and options: %s' % (sys.argv[0], filename, safe_options))
if not ipautil.file_exists(filename):
sys.exit("Replica file %s does not exist" % filename)
@@ -310,7 +311,7 @@ def main():
try:
host = get_host_name(options.no_host_dns)
except BadHostError, e:
- logging.error(str(e))
+ root_logger.error(str(e))
sys.exit(1)
if config.host_name != host:
try:
@@ -355,16 +356,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)
#Automatically disable pkinit w/ dogtag until that is supported
@@ -475,9 +476,9 @@ except Exception, e:
message = str(e)
for str in traceback.format_tb(sys.exc_info()[2]):
message = message + "\n" + str
- logging.debug(message)
+ root_logger.debug(message)
except KeyboardInterrupt:
- print "Installation cancelled."
+ print "Installation cancelled."
finally:
# always try to remove decrypted replica file
try:
@@ -487,7 +488,7 @@ finally:
pass
print ""
-print "Your system may be partly configured."
+print "Your system may be partly configured."
print "Run /usr/sbin/ipa-server-install --uninstall to clean up."
# the only way to get here is on error or ^C