Add status code to scheduler message handler
authorThierry Florac <thierry.florac@onf.fr>
Thu, 27 Aug 2015 11:41:00 +0200
changeset 18 4806161ea41a
parent 17 643ce60ce5f7
child 19 687d616d7dfb
Add status code to scheduler message handler
src/pyams_scheduler/process.py
--- a/src/pyams_scheduler/process.py	Thu Aug 27 11:39:10 2015 +0200
+++ b/src/pyams_scheduler/process.py	Thu Aug 27 11:41:00 2015 +0200
@@ -176,22 +176,23 @@
 
     def get_jobs(self, settings):
         scheduler = self.process.scheduler
-        return [{'id': job.id,
-                 'name': job.name,
-                 'trigger': '{0!s}'.format(job.trigger),
-                 'next_run': job.next_run_time.timestamp()} for job in scheduler.get_jobs()]
+        return [200,
+                [{'id': job.id,
+                  'name': job.name,
+                  'trigger': '{0!s}'.format(job.trigger),
+                  'next_run': job.next_run_time.timestamp()} for job in scheduler.get_jobs()]]
 
     def reset_task(self, settings):
         TaskResettingThread(self.process, settings).start()
-        return 'OK'
+        return [200, 'OK']
 
     def remove_task(self, settings):
         TaskRemoverThread(self.process, settings).start()
-        return 'OK'
+        return [200, 'OK']
 
     def run_task(self, settings):
         TaskRunnerThread(self.process, settings).start()
-        return 'OK'
+        return [200, 'OK']
 
 
 class SchedulerMessageHandler(ZMQMessageHandler):