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 /ipapython/ipautil.py | |
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 'ipapython/ipautil.py')
-rw-r--r-- | ipapython/ipautil.py | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/ipapython/ipautil.py b/ipapython/ipautil.py index 718f209b3..c06e7bbcf 100644 --- a/ipapython/ipautil.py +++ b/ipapython/ipautil.py @@ -26,7 +26,7 @@ IPA_BASEDN_INFO = 'ipa v2.0' import string import tempfile -import logging +from ipapython.ipa_log_manager import * import subprocess import random import os, sys, traceback, readline @@ -264,10 +264,10 @@ def run(args, stdin=None, raiseonerr=True, stderr = stderr.replace(nolog_value, 'XXXXXXXX') args = args.replace(nolog_value, 'XXXXXXXX') - logging.debug('args=%s' % args) + root_logger.debug('args=%s' % args) if capture_output: - logging.debug('stdout=%s' % stdout) - logging.debug('stderr=%s' % stderr) + root_logger.debug('stdout=%s' % stdout) + root_logger.debug('stderr=%s' % stderr) if p.returncode != 0 and raiseonerr: raise CalledProcessError(p.returncode, args) @@ -1172,21 +1172,21 @@ def get_ipa_basedn(conn): contexts = entries[0][1]['namingcontexts'] for context in contexts: - logging.debug("Check if naming context '%s' is for IPA" % context) + root_logger.debug("Check if naming context '%s' is for IPA" % context) try: entry = conn.search_s(context, ldap.SCOPE_BASE, "(info=IPA*)") except ldap.NO_SUCH_OBJECT: - logging.debug("LDAP server did not return info attribute to check for IPA version") + root_logger.debug("LDAP server did not return info attribute to check for IPA version") continue if len(entry) == 0: - logging.debug("Info attribute with IPA server version not found") + root_logger.debug("Info attribute with IPA server version not found") continue info = entry[0][1]['info'][0].lower() if info != IPA_BASEDN_INFO: - logging.debug("Detected IPA server version (%s) did not match the client (%s)" \ + root_logger.debug("Detected IPA server version (%s) did not match the client (%s)" \ % (info, IPA_BASEDN_INFO)) continue - logging.debug("Naming context '%s' is a valid IPA context" % context) + root_logger.debug("Naming context '%s' is a valid IPA context" % context) return context return None |