new: fixed rsa identity generation and implemented api enrollment plugin

This commit is contained in:
Simone Margaritelli
2019-10-06 23:25:02 +02:00
parent 107eb57f26
commit 1c251fc093
16 changed files with 127 additions and 27 deletions

View File

@ -89,6 +89,9 @@ class StatusFile(object):
if os.path.exists(path):
self._updated = datetime.fromtimestamp(os.path.getmtime(path))
def newer_then_minutes(self, minutes):
return self._updated is not None and ((datetime.now() - self._updated).seconds / 60) < minutes
def newer_then_days(self, days):
return self._updated is not None and (datetime.now() - self._updated).days < days