diff options
author | Tomas Krizek <tkrizek@redhat.com> | 2017-07-18 16:07:12 +0200 |
---|---|---|
committer | Martin Babinsky <mbabinsk@redhat.com> | 2017-07-26 15:57:56 +0200 |
commit | ba5f7afedca282e79fdfde0dd359028fc4111f90 (patch) | |
tree | d11b9052b0fc98387e96e4075751c6aa96c57840 /ipalib | |
parent | 0b8d46019172e83bdbacf7200759de640c19a2d4 (diff) | |
download | freeipa-ba5f7afedca282e79fdfde0dd359028fc4111f90.tar.gz freeipa-ba5f7afedca282e79fdfde0dd359028fc4111f90.tar.xz freeipa-ba5f7afedca282e79fdfde0dd359028fc4111f90.zip |
logging: make sure logging level is set to proper value
During py.test initialization, the value 'debug' is passed instead
of logging.DEBUG.
Signed-off-by: Tomas Krizek <tkrizek@redhat.com>
Reviewed-By: David Kupka <dkupka@redhat.com>
Diffstat (limited to 'ipalib')
-rw-r--r-- | ipalib/plugable.py | 16 |
1 files changed, 1 insertions, 15 deletions
diff --git a/ipalib/plugable.py b/ipalib/plugable.py index f6f25e833..13efe331a 100644 --- a/ipalib/plugable.py +++ b/ipalib/plugable.py @@ -461,21 +461,7 @@ class API(ReadOnly): if not match: continue - value = match.group(1) - try: - level = int(value) - except ValueError: - try: - level = { - 'debug': logging.DEBUG, - 'info': logging.INFO, - 'warn': logging.WARNING, - 'warning': logging.WARNING, - 'error': logging.ERROR, - 'critical': logging.CRITICAL - }[value] - except KeyError: - raise ValueError('unknown log level (%s)' % value) + level = ipa_log_manager.convert_log_level(match.group(1)) value = getattr(self.env, attr) regexps = re.split('\s*,\s*', value) |