Sync job status between scheduler and ui

Resolves bug: 1545682
Change-Id: I47f11677415553f8d870a65f370f453337dff064
This commit is contained in:
Memo García 2016-02-15 11:47:51 +00:00
parent 4c5ee4ca57
commit 1333614b4e
2 changed files with 11 additions and 3 deletions

View File

@ -97,7 +97,7 @@ class Job(object):
job.get('job_id'),
job.get('description'),
job.get('job_schedule', {}).get('result'),
job.get('job_schedule', {}).get('event'),
job.get('job_schedule', {}).get('status'),
job.get('client_id')
) for job in jobs]

View File

@ -83,14 +83,22 @@ class JobObject(object):
self.job_id = job_id
self.id = job_id
self.description = description
self.result = result or 'pending'
self.event = event or 'stop'
self._result = result
self._event = event
# Checking if client_id composed like <tenant_id>_<hostname>
if re.search("^[a-z0-9]{32}_.+", client_id):
self.client_id = client_id.split('_')[1]
else:
self.client_id = client_id
@property
def event(self):
return self._event or 'stop'
@property
def result(self):
return self._result or 'pending'
class JobsInSessionObject(object):
def __init__(self, job_id, session_id, client_id, result):