bputilities.kill_tasks(job_id, [task_id]) elif task_id is None: RunBatch.kill_job(job) else: task = RunBatch.BPJobTask.select_by_task_id(job, task_id) RunBatch.kill_task(task) print """ <html><head><title>Job %(job_id)d killed</title></head> <body>Job %(job_id)d killed </body> </html> """ % ( globals() ) elif batch_id is not None: RunBatch.kill_batch(batch_id) url = "ViewBatch.py?batch_id=%d" % (batch_id) print "<html><head>" print "<meta http-equiv='refresh' content='0; URL=%(url)s' />" % (globals()) print "</head>" print "<body>This page should be redirected to <a href='%(url)s'/>%(url)s</a></body>" % (globals()) print "</html>" else: print """<html><head><title>Kill jobs</title></head> <body> <h1>Kill jobs started by the imageweb webserver</h1> <form action='KillJobs.py' method='POST'> Job ID:<input type='text' name='job_id' /> <input type='submit' value='Kill'/> </form>
bputilities.kill_job(job_id) else: bputilities.kill_tasks(job_id, [task_id]) elif task_id is None: RunBatch.kill_job(job) else: task = RunBatch.BPJobTask.select_by_task_id(job, task_id) RunBatch.kill_task(task) print""" <html><head><title>Job %(job_id)d killed</title></head> <body>Job %(job_id)d killed </body> </html> """%(globals()) elif batch_id is not None: RunBatch.kill_batch(batch_id) url = "ViewBatch.py?batch_id=%d"%(batch_id) print "<html><head>" print "<meta http-equiv='refresh' content='0; URL=%(url)s' />"%(globals()) print "</head>" print "<body>This page should be redirected to <a href='%(url)s'/>%(url)s</a></body>"%(globals()) print "</html>" else: print """<html><head><title>Kill jobs</title></head> <body> <h1>Kill jobs started by the imageweb webserver</h1> <form action='KillJobs.py' method='POST'> Job ID:<input type='text' name='job_id' /> <input type='submit' value='Kill'/> </form>