1
0
mirror of https://github.com/r4sas/py-i2phosts synced 2025-01-22 04:24:15 +00:00

py-i2phosts-maint: don't try to deactivate already deactivated hosts

This commit is contained in:
Hidden Z 2010-11-27 18:57:25 +00:00
parent 7194fa8ca7
commit f9f90d4af6

View File

@ -101,8 +101,9 @@ for host in all_hosts:
# deactivate if expired
min_dl = datetime.timedelta(days=config['activate_min_delay'])
if host.expires < datetime.datetime.utcnow().date():
log.info('deactivating %s, reason: expired', host.name)
host.activated = False
if host.activated == True:
log.info('deactivating %s, reason: expired', host.name)
host.activated = False
# if not expired and added more than X days ago and approved then activate
elif dl > min_dl and host.activated == False and host.approved == True:
log.info('activating %s, reason: host up and added more than %s days ago',