summaryrefslogtreecommitdiff
path: root/lorrycontroller/stopjob.py
diff options
context:
space:
mode:
Diffstat (limited to 'lorrycontroller/stopjob.py')
-rw-r--r--lorrycontroller/stopjob.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/lorrycontroller/stopjob.py b/lorrycontroller/stopjob.py
index 947f733..f2ead87 100644
--- a/lorrycontroller/stopjob.py
+++ b/lorrycontroller/stopjob.py
@@ -28,14 +28,14 @@ class StopJob(lorrycontroller.LorryControllerRoute):
def run(self, **kwargs):
logging.info('%s %s called', self.http_method, self.path)
+ job_id = bottle.request.forms.job_id
statedb = self.open_statedb()
with statedb:
- job_id = bottle.request.forms.job_id
try:
path = statedb.find_lorry_running_job(job_id)
except lorrycontroller.WrongNumberLorriesRunningJob:
logging.warning(
"Tried to kill job %s which isn't running" % job_id)
bottle.abort(409, 'Job is not currently running')
- statedb.set_kill_job(path, True)
- return statedb.get_lorry_info(path)
+ statedb.set_kill_job(job_id, True)
+ return statedb.get_job_info(job_id)