summaryrefslogtreecommitdiff
path: root/src/leap/bitmask/keymanager/openpgp.py
diff options
context:
space:
mode:
authorKali Kaneko (leap communications) <kali@leap.se>2016-10-05 12:28:14 -0400
committerKali Kaneko (leap communications) <kali@leap.se>2016-10-07 10:22:36 -0400
commit99b53c1714d302d7f0884e03b5c102081c483504 (patch)
tree82ac74e776a330338bf94563273aa4d33f578877 /src/leap/bitmask/keymanager/openpgp.py
parent4a471fb8b434d3df07c5de42fc41590b5d9fc5f5 (diff)
[refactor] use new logger infrastructure
Diffstat (limited to 'src/leap/bitmask/keymanager/openpgp.py')
-rw-r--r--src/leap/bitmask/keymanager/openpgp.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/leap/bitmask/keymanager/openpgp.py b/src/leap/bitmask/keymanager/openpgp.py
index b07ac418..43c8d938 100644
--- a/src/leap/bitmask/keymanager/openpgp.py
+++ b/src/leap/bitmask/keymanager/openpgp.py
@@ -17,7 +17,6 @@
"""
Infrastructure for using OpenPGP keys in Key Manager.
"""
-import logging
import os
import re
import tempfile
@@ -30,6 +29,7 @@ from multiprocessing import cpu_count
from gnupg.gnupg import GPGUtilities
from twisted.internet import defer
from twisted.internet.threads import deferToThread
+from twisted.logger import Logger
from leap.common.check import leap_assert, leap_assert_type, leap_check
from leap.bitmask.keymanager import errors
@@ -61,7 +61,7 @@ from leap.bitmask.keymanager.documents import (
)
-logger = logging.getLogger(__name__)
+logger = Logger()
#
@@ -497,8 +497,8 @@ class OpenPGPScheme(object):
if len(docs) == 0:
raise errors.KeyNotFound(key)
elif len(docs) > 1:
- logger.warning("There is more than one key for fingerprint %s"
- % key.fingerprint)
+ logger.warn("There is more than one key for fingerprint %s"
+ % key.fingerprint)
has_deleted = False
deferreds = []
@@ -585,7 +585,7 @@ class OpenPGPScheme(object):
self._assert_gpg_result_ok(result)
defer.returnValue(result.data)
except errors.GPGError as e:
- logger.warning('Failed to encrypt: %s.' % str(e))
+ logger.warn('Failed to encrypt: %s.' % str(e))
raise errors.EncryptError()
@defer.inlineCallbacks
@@ -631,7 +631,7 @@ class OpenPGPScheme(object):
defer.returnValue((result.data, sign_valid))
except errors.GPGError as e:
- logger.warning('Failed to decrypt: %s.' % str(e))
+ logger.warn('Failed to decrypt: %s.' % str(e))
raise errors.DecryptError(str(e))
def is_encrypted(self, data):