Added INACTIVE in excluded from expiration
[flowspy] / flowspec / tasks.py
index d793402..412d5e4 100644 (file)
@@ -6,6 +6,7 @@ import json
 from celery.task.http import *
 from flowspy.utils import beanstalkc
 from django.conf import settings
+import datetime
 
 import os
 
@@ -67,7 +68,7 @@ def delete(route, **kwargs):
     route.status = status
     route.response = response
     route.save()
-    subtask(announce).delay("[%s] Rule removal: %s%s- Result %s" %(route.applier, route.name, reason_text, response), route.applier)
+    subtask(announce).delay("[%s] Suspending rule : %s%s- Result %s" %(route.applier, route.name, reason_text, response), route.applier)
 
 # May not work in the first place... proxy is not aware of Route models
 @task
@@ -92,6 +93,7 @@ def batch_delete(routes, **kwargs):
         for route in routes:
             route.status = status
             route.response = response
+            route.expires = datetime.date.today()
             route.save()
             subtask(announce).delay("[%s] Rule removal: %s%s- Result %s" %(route.applier, route.name, reason_text, response), route.applier)
     else: