diff options
author | Abhijeet Kasurde <akasurde@redhat.com> | 2019-11-26 19:11:02 +0100 |
---|---|---|
committer | Sloane Hertel <shertel@redhat.com> | 2019-11-26 19:11:02 +0100 |
commit | 8d0c2cd4d50307f96893464f425fc0e9d303f890 (patch) | |
tree | da7fe7ad3c1d70a6633f0e5ffb545c794de43103 /test/integration/targets/include_vars | |
parent | Add or later to the license expressed in the README (diff) | |
download | ansible-8d0c2cd4d50307f96893464f425fc0e9d303f890.tar.xz ansible-8d0c2cd4d50307f96893464f425fc0e9d303f890.zip |
include_vars: Check NoneType for raw_params (#64979)
Lookup 'first_found' returns empty list which results in
raw_params checking. Check NoneType for 'raw_params' before
proceeding.
Fixes: #64939
Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
Diffstat (limited to 'test/integration/targets/include_vars')
-rw-r--r-- | test/integration/targets/include_vars/tasks/main.yml | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/test/integration/targets/include_vars/tasks/main.yml b/test/integration/targets/include_vars/tasks/main.yml index 813801aa59..ab2442c6fa 100644 --- a/test/integration/targets/include_vars/tasks/main.yml +++ b/test/integration/targets/include_vars/tasks/main.yml @@ -138,3 +138,17 @@ assert: that: - "service_name == 'my_custom_service'" + +- name: Check NoneType for raw params and file + include_vars: + file: "{{ lookup('first_found', possible_files, errors='ignore') }}" + vars: + possible_files: + - "does_not_exist.yml" + ignore_errors: True + register: include_with_non_existent_file + +- name: Verify that file and raw_params provide correct error message to user + assert: + that: + - "'Could not find file' in include_with_non_existent_file.message" |