mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Remove nonsense comment and react on generally absent path name
This commit is contained in:
parent
47d21d9ed2
commit
e6958f7f15
1 changed files with 3 additions and 4 deletions
|
@ -545,10 +545,9 @@ def extracted(name,
|
|||
ret['comment'] = '{0} is not an absolute path'.format(name)
|
||||
return ret
|
||||
else:
|
||||
if name is None:
|
||||
# Only way this happens is if some doofus specifies "- name: None"
|
||||
# in their SLS file. Prevent tracebacks by failing gracefully.
|
||||
ret['comment'] = 'None is not a valid directory path'
|
||||
if not name:
|
||||
# Empty name, like None, '' etc.
|
||||
ret['comment'] = 'Name of the directory path needs to be specified'
|
||||
return ret
|
||||
# os.path.isfile() returns False when there is a trailing slash, hence
|
||||
# our need for first stripping the slash and then adding it back later.
|
||||
|
|
Loading…
Add table
Reference in a new issue