Fix stdout_lines check

This patch checks the length of stdout rather than the length
of stdout_lines to avoid errors when the output is empty.

Change-Id: I1dd68d37ea4884d164727d697a879cf1a09c2c9a
This commit is contained in:
Major Hayden
2016-10-31 13:21:12 -05:00
parent 1a0724d9da
commit bc9cc7b13b
2 changed files with 3 additions and 3 deletions

View File

@@ -41,7 +41,7 @@
rhel_07_010020_violations: "{{ rhel_07_010020_files.stdout_lines | default([]) | join(', ') }}"
when:
- rhel_07_010020_files is defined
- rhel_07_010020_files.stdout_lines | length > 0
- rhel_07_010020_files.stdout is defined
tags:
- high
- RHEL-07-010020
@@ -56,7 +56,7 @@
when:
- ansible_os_family | lower == 'debian'
- rhel_07_010020_files is defined
- rhel_07_010020_files.stdout_lines | length > 0
- rhel_07_010020_files.stdout is defined
tags:
- high
- RHEL-07-010020

View File

@@ -38,7 +38,7 @@
- not check_mode | bool
- ansible_os_family | lower == 'redhat'
- rhel_07_010020_files is defined
- rhel_07_010020_files.stdout_lines | length > 0
- rhel_07_010020_files.stdout is defined
tags:
- high
- RHEL-07-010020