Commit cf9ada49 authored by Michael Hanselmann's avatar Michael Hanselmann

RAPI client: Rename “DeleteJob” to “CancelJob”

Jobs can't be deleted, but cancelled (even though the HTTP method
“DELETE” is used).
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarDavid Knowles <dknowles@google.com>
parent cfc03c54
......@@ -760,8 +760,8 @@ class GanetiRapiClient(object):
"""
return self._SendRequest(HTTP_GET, "/2/jobs/%d" % job_id, None, None)
def DeleteJob(self, job_id, dry_run=False):
"""Deletes a job.
def CancelJob(self, job_id, dry_run=False):
"""Cancels a job.
@type job_id: int
@param job_id: id of the job to delete
......
......@@ -324,10 +324,10 @@ class GanetiRapiClientTests(unittest.TestCase):
self.assertHandler(rlib2.R_2_jobs_id)
self.assertItems(["1234"])
def testDeleteJob(self):
def testCancelJob(self):
self.rapi.AddResponse("[true, \"Job 123 will be canceled\"]")
self.assertEqual([True, "Job 123 will be canceled"],
self.client.DeleteJob(999, dry_run=True))
self.client.CancelJob(999, dry_run=True))
self.assertHandler(rlib2.R_2_jobs_id)
self.assertItems(["999"])
self.assertDryRun()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment