1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Allow for empty source in dwim_path_relative_stack

Fixes #17192
This commit is contained in:
James Cammarata 2016-09-21 15:52:26 -05:00
parent 39c5c558f8
commit c9d3d2b9a0

View file

@ -291,9 +291,9 @@ class DataLoader():
b_source = to_bytes(source) b_source = to_bytes(source)
result = None result = None
if not source: if source is None:
display.warning('Invalid request to find a file that matches an empty string or "null" value') display.warning('Invalid request to find a file that matches a "null" value')
elif source.startswith('~') or source.startswith(os.path.sep): elif source and (source.startswith('~') or source.startswith(os.path.sep)):
# path is absolute, no relative needed, check existence and return source # path is absolute, no relative needed, check existence and return source
test_path = unfrackpath(b_source) test_path = unfrackpath(b_source)
if os.path.exists(to_bytes(test_path, errors='surrogate_or_strict')): if os.path.exists(to_bytes(test_path, errors='surrogate_or_strict')):