From a0ccb5c42037006cfab560a00dd6423c5bceb238 Mon Sep 17 00:00:00 2001 From: Marc Aymerich Date: Wed, 13 May 2015 14:28:41 +0000 Subject: [PATCH] Deleted resource backend support --- orchestra/contrib/resources/models.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/orchestra/contrib/resources/models.py b/orchestra/contrib/resources/models.py index 4ad8a8f4..4d48aab7 100644 --- a/orchestra/contrib/resources/models.py +++ b/orchestra/contrib/resources/models.py @@ -128,20 +128,20 @@ class Resource(models.Model): def sync_periodic_task(self): name = 'monitor.%s' % str(self) - if resource.pk and resource.crontab: + if self.pk and self.crontab: try: task = PeriodicTask.objects.get(name=name) except PeriodicTask.DoesNotExist: - if resource.is_active: + if self.is_active: PeriodicTask.objects.create( name=name, task='resources.Monitor', - args=[resource.pk], - crontab=resource.crontab + args=[self.pk], + crontab=self.crontab ) else: - if task.crontab != resource.crontab: - task.crontab = resource.crontab + if task.crontab != self.crontab: + task.crontab = self.crontab task.save(update_fields=['crontab']) else: PeriodicTask.objects.filter(name=name).delete()