From b0f4dc06c489c59053f3e84f3c9b7d81b8273543 Mon Sep 17 00:00:00 2001 From: Matthew Jones Date: Mon, 9 May 2016 15:29:03 -0400 Subject: [PATCH] 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 --- awx/plugins/library/scan_services.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/awx/plugins/library/scan_services.py b/awx/plugins/library/scan_services.py index f417a3fdfa..1632ffab39 100644 --- a/awx/plugins/library/scan_services.py +++ b/awx/plugins/library/scan_services.py @@ -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()