mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Fix some integration tests
This commit is contained in:
parent
a24b964ea5
commit
3f0499cbc4
@ -3368,6 +3368,10 @@ def stats(path, hash_type=None, follow_symlinks=True):
|
||||
pstat = os.lstat(path)
|
||||
except OSError:
|
||||
# Not a broken symlink, just a nonexistent path
|
||||
# NOTE: The file.directory state checks the content of the error
|
||||
# message in this exception. Any changes made to the message for this
|
||||
# exception will reflect the file.directory state as well, and will
|
||||
# likely require changes there.
|
||||
raise CommandExecutionError('Path not found: {0}'.format(path))
|
||||
else:
|
||||
if follow_symlinks:
|
||||
@ -4193,12 +4197,6 @@ def check_perms(name, ret, user, group, mode, follow_symlinks=False):
|
||||
# Check permissions
|
||||
perms = {}
|
||||
cur = stats(name, follow_symlinks=follow_symlinks)
|
||||
if not cur:
|
||||
# NOTE: The file.directory state checks the content of the error
|
||||
# message in this exception. Any changes made to the message for this
|
||||
# exception will reflect the file.directory state as well, and will
|
||||
# likely require changes there.
|
||||
raise CommandExecutionError('{0} does not exist'.format(name))
|
||||
perms['luser'] = cur['user']
|
||||
perms['lgroup'] = cur['group']
|
||||
perms['lmode'] = salt.utils.normalize_mode(cur['mode'])
|
||||
|
@ -2988,7 +2988,7 @@ def directory(name,
|
||||
ret, _ = __salt__['file.check_perms'](
|
||||
full, ret, user, group, dir_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 clean:
|
||||
|
Loading…
Reference in New Issue
Block a user