fix session-remove-job

Wrong values in job's json-schema prevented the
api from unlinking a job's document from the session.
This is fixed

Change-Id: I6be73b48f438982b040684e3316ba10dd16f3018
Closes-Bug: #1556933
This commit is contained in:
Fabrizio Vanni 2016-03-14 13:07:33 +00:00
parent 6ba1df0e0a
commit ab84438f8c
3 changed files with 14 additions and 12 deletions

View File

@ -335,8 +335,10 @@ class SessionsJob(resource.BaseResource):
doc=session_doc)
job_update_doc = {
'session_id': '',
'session_tag': '',
'job_event': 'stop'
'session_tag': 0,
'job_schedule': {
'event': 'stop'
}
}
self.db.update_job(user_id=user_id,
job_id=job_id,

View File

@ -193,12 +193,11 @@ job_schema = {
},
"session_id": {
"id": "session_id",
"pattern": "^[\w-]+$",
"pattern": "^[\w-]*$",
"type": "string"
},
"session_tag": {
"id": "session_tag",
"pattern": "^[\w-]+$",
"type": "integer"
},
"session_name": {
@ -285,12 +284,11 @@ job_patch_schema = {
},
"session_id": {
"id": "session_id",
"pattern": "^[\w-]+$",
"pattern": "^[\w-]*$",
"type": "string"
},
"session_tag": {
"id": "session_tag",
"pattern": "^[\w-]+$",
"type": "integer"
},
"session_name": {
@ -376,11 +374,11 @@ session_schema = {
"type": "integer"
},
"time_started": {
"id": "session_tag",
"id": "time_started",
"type": "integer"
},
"time_ended": {
"id": "session_tag",
"id": "time_ended",
"type": "integer"
},
},
@ -411,11 +409,11 @@ session_patch_schema = {
"type": "integer"
},
"time_started": {
"id": "session_tag",
"id": "time_started",
"type": "integer"
},
"time_ended": {
"id": "session_tag",
"id": "time_ended",
"type": "integer"
},
},

View File

@ -422,8 +422,10 @@ class TestSessionsJobs(unittest.TestCase):
job_update_doc = {
'session_id': '',
'session_tag': '',
'job_event': 'stop'
'session_tag': 0,
'job_schedule': {
'event': 'stop'
}
}
self.resource.on_delete(self.mock_req, self.mock_req,