Fix missing file error in file.directory.

file.check_perms raises CommandExecutionError with message that starts with
'Path not found' when file or directory was deleted between _depth_limited_walk
and actual permissions check. This error was correctly ignored for directories,
but not for files. This commit fixes error message check for files.
This commit is contained in:
ethframe 2019-01-21 22:23:28 +03:00
parent acfb7d89b4
commit c10882579f

View file

@ -3155,7 +3155,7 @@ def directory(name,
ret, _ = __salt__['file.check_perms'](
full, ret, user, group, file_mode, follow_symlinks)
except CommandExecutionError as exc:
if not exc.strerror.endswith('does not exist'):
if not exc.strerror.startswith('Path not found'):
errors.append(exc.strerror)
if check_dirs: