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/adtrustinstance.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/adtrustinstance.py')
-rw-r--r-- | ipaserver/install/adtrustinstance.py | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/ipaserver/install/adtrustinstance.py b/ipaserver/install/adtrustinstance.py index d1dc759c6..f655b2004 100644 --- a/ipaserver/install/adtrustinstance.py +++ b/ipaserver/install/adtrustinstance.py @@ -17,8 +17,6 @@ # along with this program. If not, see <http://www.gnu.org/licenses/>. # -import logging - import os import errno import ldap @@ -30,6 +28,7 @@ from ipaserver.install.dsinstance import realm_to_serverid from ipalib import errors from ipapython import sysrestore from ipapython import ipautil +from ipapython.ipa_log_manager import * import random import string @@ -119,7 +118,7 @@ class ADTRUSTInstance(service.Service): try: self.admin_conn.modify_s(self.suffix, mod) except ldap.TYPE_OR_VALUE_EXISTS: - logging.debug("samba user aci already exists in suffix %s on %s" % (self.suffix, self.admin_conn.host)) + root_logger.debug("samba user aci already exists in suffix %s on %s" % (self.suffix, self.admin_conn.host)) def __gen_sid_string(self): sub_ids = struct.unpack("<LLL", os.urandom(12)) @@ -237,20 +236,20 @@ class ADTRUSTInstance(service.Service): "-k", "/etc/krb5.keytab"]) except ipautil.CalledProcessError, e: if e.returncode != 5: - logging.critical("Failed to remove old key for %s" % cifs_principal) + root_logger.critical("Failed to remove old key for %s" % cifs_principal) try: ipautil.run(["ipa-getkeytab", "--server", self.fqdn, "--principal", cifs_principal, "-k", "/etc/krb5.keytab"]) except ipautil.CalledProcessError, e: - logging.critical("Failed to add key for %s" % cifs_principal) + root_logger.critical("Failed to add key for %s" % cifs_principal) def __start(self): try: self.start() except: - logging.critical("smbd service failed to start") + root_logger.critical("smbd service failed to start") def __stop(self): self.backup_state("running", self.is_running()) @@ -267,7 +266,7 @@ class ADTRUSTInstance(service.Service): try: self.ldap_enable('ADTRUST', self.fqdn, self.dm_password, self.suffix) except ldap.ALREADY_EXISTS: - logging.critical("ADTRUST Service startup entry already exists.") + root_logger.critical("ADTRUST Service startup entry already exists.") pass def __setup_sub_dict(self): @@ -332,7 +331,7 @@ class ADTRUSTInstance(service.Service): try: self.fstore.restore_file(f) except ValueError, error: - logging.debug(error) + root_logger.debug(error) pass if not enabled is None and not enabled: |