summaryrefslogtreecommitdiff
path: root/src/leap/keymanager/keys.py
diff options
context:
space:
mode:
authorRuben Pollan <meskio@sindominio.net>2015-06-26 18:12:22 +0200
committerRuben Pollan <meskio@sindominio.net>2015-06-27 00:39:36 +0200
commitd7acaf356d16c795f1481fefc7a75ffc8a36b1d0 (patch)
treed7767fca75892cfa7b2a80b4adbe3928f8f6c07e /src/leap/keymanager/keys.py
parentb1ac5bdbed955cf5a88c76dd90691266e45d277c (diff)
[bug] remove the dependency on enum34
* Resolves: #7188
Diffstat (limited to 'src/leap/keymanager/keys.py')
-rw-r--r--src/leap/keymanager/keys.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/leap/keymanager/keys.py b/src/leap/keymanager/keys.py
index 562c0a9..91559c2 100644
--- a/src/leap/keymanager/keys.py
+++ b/src/leap/keymanager/keys.py
@@ -35,7 +35,7 @@ from datetime import datetime
from leap.common.check import leap_assert
from twisted.internet import defer
-from leap.keymanager.validation import ValidationLevel, toValidationLevel
+from leap.keymanager.validation import ValidationLevels
logger = logging.getLogger(__name__)
@@ -120,11 +120,11 @@ def build_key_from_dict(kClass, kdict):
:rtype: C{kClass}
"""
try:
- validation = toValidationLevel(kdict[KEY_VALIDATION_KEY])
+ validation = ValidationLevels.get(kdict[KEY_VALIDATION_KEY])
except ValueError:
logger.error("Not valid validation level (%s) for key %s",
(kdict[KEY_VALIDATION_KEY], kdict[KEY_ID_KEY]))
- validation = ValidationLevel.Weak_Chain
+ validation = ValidationLevels.Weak_Chain
expiry_date = _to_datetime(kdict[KEY_EXPIRY_DATE_KEY])
last_audited_at = _to_datetime(kdict[KEY_LAST_AUDITED_AT_KEY])
@@ -176,7 +176,7 @@ class EncryptionKey(object):
def __init__(self, address, key_id="", fingerprint="",
key_data="", private=False, length=0, expiry_date=None,
- validation=ValidationLevel.Weak_Chain, last_audited_at=None,
+ validation=ValidationLevels.Weak_Chain, last_audited_at=None,
refreshed_at=None, encr_used=False, sign_used=False):
self.address = address
self.key_id = key_id
@@ -213,7 +213,7 @@ class EncryptionKey(object):
KEY_EXPIRY_DATE_KEY: expiry_date,
KEY_LAST_AUDITED_AT_KEY: last_audited_at,
KEY_REFRESHED_AT_KEY: refreshed_at,
- KEY_VALIDATION_KEY: self.validation.name,
+ KEY_VALIDATION_KEY: str(self.validation),
KEY_ENCR_USED_KEY: self.encr_used,
KEY_SIGN_USED_KEY: self.sign_used,
KEY_TAGS_KEY: [KEYMANAGER_KEY_TAG],