diff options
author | John Dennis <jdennis@redhat.com> | 2011-11-15 14:39:31 -0500 |
---|---|---|
committer | Martin Kosek <mkosek@redhat.com> | 2011-11-23 09:36:18 +0100 |
commit | 56401c1abe7d4c78650acfcd9bbe8c8edc1dac57 (patch) | |
tree | a759f9fb51d4e2e110c55dbecc45f436386ee30f /install/tools/ipa-replica-manage | |
parent | 730f1228a91ec9c6e575181807da2ab994a38071 (diff) | |
download | freeipa-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-manage')
-rwxr-xr-x | install/tools/ipa-replica-manage | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/install/tools/ipa-replica-manage b/install/tools/ipa-replica-manage index e4ff7166e..8506fcba7 100755 --- a/install/tools/ipa-replica-manage +++ b/install/tools/ipa-replica-manage @@ -21,7 +21,7 @@ import sys import os import ldap, re, krbV -import traceback, logging +import traceback from ipapython import ipautil from ipaserver.install import replication, dsinstance, installutils @@ -29,6 +29,7 @@ from ipaserver.install import bindinstance from ipaserver import ipaldap from ipapython import version from ipalib import api, errors, util +from ipapython.ipa_log_manager import * CACERT = "/etc/ipa/ca.crt" @@ -93,13 +94,6 @@ def parse_options(): cmdstr = " | ".join(commands.keys()) parser.error("must provide a command [%s]" % cmdstr) - # set log level - if options.verbose: - # if verbose, output events at INFO level if not already - mylogger = logging.getLogger() - if mylogger.getEffectiveLevel() > logging.INFO: - mylogger.setLevel(logging.INFO) - # else user has already configured logging externally lower return options, args def test_connection(realm, host): @@ -346,7 +340,7 @@ def add_link(realm, replica1, replica2, dirman_passwd, options): if options.winsync: if not options.binddn or not options.bindpw or not options.cacert or not options.passsync: - logging.error("The arguments --binddn, --bindpw, --passsync and --cacert are required to create a winsync agreement") + root_logger.error("The arguments --binddn, --bindpw, --passsync and --cacert are required to create a winsync agreement") sys.exit(1) if options.cacert: @@ -396,10 +390,10 @@ def re_initialize(realm, options): filter = "(&(nsDS5ReplicaHost=%s)(|(objectclass=nsDSWindowsReplicationAgreement)(objectclass=nsds5ReplicationAgreement)))" % thishost entry = repl.conn.search_s("cn=config", ldap.SCOPE_SUBTREE, filter) if len(entry) == 0: - logging.error("Unable to find %s -> %s replication agreement" % (options.fromhost, thishost)) + root_logger.error("Unable to find %s -> %s replication agreement" % (options.fromhost, thishost)) sys.exit(1) if len(entry) > 1: - logging.error("Found multiple agreements for %s. Only initializing the first one returned: %s" % (thishost, entry[0].dn)) + root_logger.error("Found multiple agreements for %s. Only initializing the first one returned: %s" % (thishost, entry[0].dn)) repl.initialize_replication(entry[0].dn, repl.conn) repl.wait_for_repl_init(repl.conn, entry[0].dn) @@ -422,8 +416,9 @@ def main(): # Just initialize the environment. This is so the installer can have # access to the plugin environment - api_env = {} - api_env['in_server'] = True + api_env = {'in_server' : True, + 'verbose' : options.verbose, + } if os.getegid() != 0: api_env['log'] = None # turn off logging for non-root |