diff --git a/disaster_recovery/api/api.py b/disaster_recovery/api/api.py index 39b36c2..0ac8ec9 100644 --- a/disaster_recovery/api/api.py +++ b/disaster_recovery/api/api.py @@ -102,7 +102,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] diff --git a/disaster_recovery/utils.py b/disaster_recovery/utils.py index c7bff13..7626683 100644 --- a/disaster_recovery/utils.py +++ b/disaster_recovery/utils.py @@ -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 _ 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):