diff --git a/awx/main/models/inventory.py b/awx/main/models/inventory.py index bee15004a7..61d187735b 100644 --- a/awx/main/models/inventory.py +++ b/awx/main/models/inventory.py @@ -1143,10 +1143,9 @@ class InventorySource(UnifiedJobTemplate, InventorySourceOptions): return self.current_job.status elif not self.last_job: return 'never updated' - elif self.last_job_failed: - return 'failed' + # inherit the child job status else: - return 'successful' + return self.last_job.status else: return 'none' diff --git a/awx/main/models/projects.py b/awx/main/models/projects.py index ddeb33e150..a762206476 100644 --- a/awx/main/models/projects.py +++ b/awx/main/models/projects.py @@ -253,12 +253,16 @@ class Project(UnifiedJobTemplate, ProjectOptions): return self.current_job.status elif not self.last_job: return 'never updated' + # inherit the child job status on failure elif self.last_job_failed: - return 'failed' + return self.last_job.status + # Even on a successful child run, a missing project path overides + # the successful status elif not self.get_project_path(): return 'missing' + # Return the successful status else: - return 'successful' + return self.last_job.status elif not self.get_project_path(): return 'missing' else: