diff options
author | Ruben Pollan <meskio@sindominio.net> | 2015-01-05 08:54:24 -0600 |
---|---|---|
committer | Ruben Pollan <meskio@sindominio.net> | 2015-01-15 13:10:57 -0600 |
commit | 82d027b1f471517213bdcdc773dc8eea677fe330 (patch) | |
tree | 4e91d829a7185be9cb127592747eb72866d47f77 /src/leap/keymanager/validation.py | |
parent | 6fa8b2a9e7f02c59f794e9dd080fac574841e50b (diff) |
Port validation levels to enum34
Diffstat (limited to 'src/leap/keymanager/validation.py')
-rw-r--r-- | src/leap/keymanager/validation.py | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/leap/keymanager/validation.py b/src/leap/keymanager/validation.py index c6fe478b..c81d533a 100644 --- a/src/leap/keymanager/validation.py +++ b/src/leap/keymanager/validation.py @@ -24,17 +24,17 @@ See: from datetime import datetime -from enum import Enum +from enum import IntEnum -ValidationLevel = Enum( - "Weak_Chain", - "Provider_Trust", - "Provider_Endorsement", - "Third_Party_Endorsement", - "Third_Party_Consensus", - "Historically_Auditing", - "Known_Key", +ValidationLevel = IntEnum("ValidationLevel", + "Weak_Chain " + "Provider_Trust " + "Provider_Endorsement " + "Third_Party_Endorsement " + "Third_Party_Consensus " + "Historically_Auditing " + "Known_Key " "Fingerprint") @@ -49,7 +49,7 @@ def toValidationLevel(value): :raises ValueError: if C{value} is not a validation level """ for level in ValidationLevel: - if value == str(level): + if value == level.name: return level raise ValueError("Not valid validation level: %s" % (value,)) |