mirror of
https://github.com/ansible/awx.git
synced 2026-03-14 07:27:28 -02:30
Fix fail/skip scenario for scan service jobs
In the case where no services could be found we'll set the status as skipped instead of failed
This commit is contained in:
@@ -183,10 +183,11 @@ def main():
|
||||
if svcmod.incomplete_warning:
|
||||
incomplete_warning = True
|
||||
if len(all_services) == 0:
|
||||
module.fail_json(msg="Failed to find any services. Sometimes this is due to insufficient privileges.")
|
||||
results = dict(ansible_facts=dict(services=all_services))
|
||||
if incomplete_warning:
|
||||
results['msg'] = "WARNING: Could not find status for all services. Sometimes this is due to insufficient privileges."
|
||||
results = dict(skipped=True, msg="Failed to find any services. Sometimes this is due to insufficient privileges.")
|
||||
else:
|
||||
results = dict(ansible_facts=dict(services=all_services))
|
||||
if incomplete_warning:
|
||||
results['msg'] = "WARNING: Could not find status for all services. Sometimes this is due to insufficient privileges."
|
||||
module.exit_json(**results)
|
||||
|
||||
main()
|
||||
|
||||
Reference in New Issue
Block a user