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 /ipaserver/install/service.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 'ipaserver/install/service.py')
-rw-r--r-- | ipaserver/install/service.py | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/ipaserver/install/service.py b/ipaserver/install/service.py index c9ff793f7..249727b15 100644 --- a/ipaserver/install/service.py +++ b/ipaserver/install/service.py @@ -17,7 +17,7 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # -import logging, sys +import sys import os, socket import tempfile from ipapython import sysrestore @@ -30,6 +30,7 @@ import base64 import time import datetime from ipaserver.install import installutils +from ipapython.ipa_log_manager import * CACERT = "/etc/ipa/ca.crt" @@ -43,7 +44,7 @@ SERVICE_LIST = { } def print_msg(message, output_fd=sys.stdout): - logging.debug(message) + root_logger.debug(message) output_fd.write(message) output_fd.write("\n") @@ -110,7 +111,7 @@ class Service(object): try: ipautil.run(args, nolog=nologlist) except ipautil.CalledProcessError, e: - logging.critical("Failed to load %s: %s" % (ldif, str(e))) + root_logger.critical("Failed to load %s: %s" % (ldif, str(e))) finally: if pw_name: os.remove(pw_name) @@ -177,7 +178,7 @@ class Service(object): try: self.admin_conn.modify_s(dn, mod) except Exception, e: - logging.critical("Could not add certificate to service %s entry: %s" % (self.principal, str(e))) + root_logger.critical("Could not add certificate to service %s entry: %s" % (self.principal, str(e))) def is_configured(self): return self.sstore.has_state(self.service_name) @@ -249,7 +250,7 @@ class Service(object): method() e = datetime.datetime.now() d = e - s - logging.debug(" duration: %d seconds" % d.seconds) + root_logger.debug(" duration: %d seconds" % d.seconds) step += 1 self.print_msg("done configuring %s." % self.service_name) @@ -267,7 +268,7 @@ class Service(object): else: conn.do_sasl_gssapi_bind() except Exception, e: - logging.debug("Could not connect to the Directory Server on %s: %s" % (fqdn, str(e))) + root_logger.debug("Could not connect to the Directory Server on %s: %s" % (fqdn, str(e))) raise e return conn @@ -290,7 +291,7 @@ class Service(object): try: conn.add_s(entry) except ldap.ALREADY_EXISTS, e: - logging.critical("failed to add %s Service startup entry" % name) + root_logger.critical("failed to add %s Service startup entry" % name) raise e class SimpleServiceInstance(Service): |