mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
warn when searching for an empty string or null
This commit is contained in:
parent
04a60a1db4
commit
4e14b7b783
1 changed files with 3 additions and 1 deletions
|
@ -281,7 +281,9 @@ class DataLoader():
|
|||
find one file in first path in stack taking roles into account and adding play basedir as fallback
|
||||
'''
|
||||
result = None
|
||||
if source.startswith('~') or source.startswith(os.path.sep):
|
||||
if not source:
|
||||
display.warning('Invalid request to find a file that matches an empty string or "null" value')
|
||||
elif source.startswith('~') or source.startswith(os.path.sep):
|
||||
# path is absolute, no relative needed, check existence and return source
|
||||
test_path = to_bytes(unfrackpath(source),errors='strict')
|
||||
if os.path.exists(test_path):
|
||||
|
|
Loading…
Reference in a new issue