Sync job status between scheduler and ui
Resolves bug: 1545682 Change-Id: I47f11677415553f8d870a65f370f453337dff064
This commit is contained in:
parent
4c5ee4ca57
commit
1333614b4e
@ -97,7 +97,7 @@ class Job(object):
|
|||||||
job.get('job_id'),
|
job.get('job_id'),
|
||||||
job.get('description'),
|
job.get('description'),
|
||||||
job.get('job_schedule', {}).get('result'),
|
job.get('job_schedule', {}).get('result'),
|
||||||
job.get('job_schedule', {}).get('event'),
|
job.get('job_schedule', {}).get('status'),
|
||||||
job.get('client_id')
|
job.get('client_id')
|
||||||
) for job in jobs]
|
) for job in jobs]
|
||||||
|
|
||||||
|
@ -83,14 +83,22 @@ class JobObject(object):
|
|||||||
self.job_id = job_id
|
self.job_id = job_id
|
||||||
self.id = job_id
|
self.id = job_id
|
||||||
self.description = description
|
self.description = description
|
||||||
self.result = result or 'pending'
|
self._result = result
|
||||||
self.event = event or 'stop'
|
self._event = event
|
||||||
# Checking if client_id composed like <tenant_id>_<hostname>
|
# Checking if client_id composed like <tenant_id>_<hostname>
|
||||||
if re.search("^[a-z0-9]{32}_.+", client_id):
|
if re.search("^[a-z0-9]{32}_.+", client_id):
|
||||||
self.client_id = client_id.split('_')[1]
|
self.client_id = client_id.split('_')[1]
|
||||||
else:
|
else:
|
||||||
self.client_id = client_id
|
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):
|
class JobsInSessionObject(object):
|
||||||
def __init__(self, job_id, session_id, client_id, result):
|
def __init__(self, job_id, session_id, client_id, result):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user