From f9f90d4af66d04c15445de8e49c8b5265cb2629c Mon Sep 17 00:00:00 2001 From: Hidden Z Date: Sat, 27 Nov 2010 18:57:25 +0000 Subject: [PATCH] py-i2phosts-maint: don't try to deactivate already deactivated hosts --- py-i2phosts-maint | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/py-i2phosts-maint b/py-i2phosts-maint index 922a776..6891b9b 100755 --- a/py-i2phosts-maint +++ b/py-i2phosts-maint @@ -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',