summaryrefslogtreecommitdiffstats
path: root/install/migration/migration.py
diff options
context:
space:
mode:
authorJohn Dennis <jdennis@redhat.com>2011-11-15 14:39:31 -0500
committerMartin Kosek <mkosek@redhat.com>2011-11-23 09:36:18 +0100
commit56401c1abe7d4c78650acfcd9bbe8c8edc1dac57 (patch)
treea759f9fb51d4e2e110c55dbecc45f436386ee30f /install/migration/migration.py
parent730f1228a91ec9c6e575181807da2ab994a38071 (diff)
downloadfreeipa-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/migration/migration.py')
-rw-r--r--install/migration/migration.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/install/migration/migration.py b/install/migration/migration.py
index 8edd67869..449d35c66 100644
--- a/install/migration/migration.py
+++ b/install/migration/migration.py
@@ -25,7 +25,7 @@ import errno
import glob
import ldap
import wsgiref
-import logging
+from ipapython.ipa_log_manager import *
from ipapython.ipautil import get_ipa_basedn
BASE_DN = ''
@@ -68,7 +68,7 @@ def get_base_dn():
conn.simple_bind_s('', '')
BASE_DN = get_ipa_basedn(conn)
except ldap.LDAPError, e:
- logging.error('migration context search failed: %s' % e)
+ root_logger.error('migration context search failed: %s' % e)
return ''
finally:
conn.unbind_s()
@@ -78,7 +78,7 @@ def get_base_dn():
def bind(username, password):
base_dn = get_base_dn()
if not base_dn:
- logging.error('migration unable to get base dn')
+ root_logger.error('migration unable to get base dn')
raise IOError(errno.EIO, 'Cannot get Base DN')
bind_dn = 'uid=%s,cn=users,cn=accounts,%s' % (username, base_dn)
try:
@@ -86,10 +86,10 @@ def bind(username, password):
conn.simple_bind_s(bind_dn, password)
except (ldap.INVALID_CREDENTIALS, ldap.UNWILLING_TO_PERFORM,
ldap.NO_SUCH_OBJECT), e:
- logging.error('migration invalid credentials for %s: %s' % (bind_dn, convert_exception(e)))
+ root_logger.error('migration invalid credentials for %s: %s' % (bind_dn, convert_exception(e)))
raise IOError(errno.EPERM, 'Invalid LDAP credentials for user %s' % username)
except ldap.LDAPError, e:
- logging.error('migration bind failed: %s' % convert_exception(e))
+ root_logger.error('migration bind failed: %s' % convert_exception(e))
raise IOError(errno.EIO, 'Bind error')
finally:
conn.unbind_s()