summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNavaL <ayoyo@thoughtworks.com>2016-12-05 15:21:38 +0100
committerRuben Pollan <meskio@sindominio.net>2017-12-03 20:43:33 +0100
commit1986316b7150a91798baea35e4b7507c3f4a337d (patch)
treeddca742326db755f47938ca7cb161a425eae9c4d /src
parenta164b1daa6bcbbf6bffe84d6b02ed2be43c29e7f (diff)
[style] refactoring: renaming methods/variables
Diffstat (limited to 'src')
-rw-r--r--src/leap/bitmask/keymanager/keys.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/leap/bitmask/keymanager/keys.py b/src/leap/bitmask/keymanager/keys.py
index 1e8d383f..4a3aa403 100644
--- a/src/leap/bitmask/keymanager/keys.py
+++ b/src/leap/bitmask/keymanager/keys.py
@@ -30,8 +30,8 @@ from leap.bitmask.keymanager.wrapper import TempGPGWrapper
from leap.bitmask.keymanager.validation import ValidationLevels
from leap.bitmask.keymanager import documents as doc
-TWO_MONTHS = 60
-DEFAULT_THRESHOLD = TWO_MONTHS
+TWO_MONTHS = 60 # 60 days
+DEFAULT_THRESHOLD = TWO_MONTHS # extend or renew key, 2months prior to expiry
log = Logger()
@@ -327,21 +327,21 @@ class OpenPGPKey(object):
return False if self.expiry_date is None \
else self.expiry_date < datetime.now()
- def should_be_renewed(self, before_expiry_threshold=DEFAULT_THRESHOLD):
+ def needs_renewal(self, pre_expiration_threshold=DEFAULT_THRESHOLD):
"""
- Indicates if the key reaches the renewal period. For ease of transition
- keys should be renewed before they expire.
+ Indicates if the key is inside the renewal period. For ease of
+ transition keys should be renewed before they expire.
- :param before_expiry_threshold: the amount of days before expiry date
+ :param pre_expiration_threshold: the amount of days before expiry date
whereby the key should be renewed -- default value is 60 days
- :type before_expiry_threshold: int
+ :type pre_expiration_threshold: int
:return: True if the current date is within the threshold
:rtype: Boolean
"""
days_till_expiry = (self.expiry_date - datetime.now())
- return days_till_expiry.days < before_expiry_threshold
+ return days_till_expiry.days < pre_expiration_threshold
def parse_address(address):