From 56401c1abe7d4c78650acfcd9bbe8c8edc1dac57 Mon Sep 17 00:00:00 2001 From: John Dennis Date: Tue, 15 Nov 2011 14:39:31 -0500 Subject: 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() --- ipapython/ipautil.py | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'ipapython/ipautil.py') 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 -- cgit