mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Do not check perms in file.copy if preserve
This commit is contained in:
parent
02a78fce3d
commit
85d461f748
1 changed files with 5 additions and 1 deletions
|
@ -3643,7 +3643,11 @@ def copy(
|
|||
try:
|
||||
shutil.copy(source, name)
|
||||
ret['changes'] = {name: source}
|
||||
__salt__['file.check_perms'](name, ret, user, group, mode)
|
||||
# Preserve really means just keep the behavior of the cp command. If
|
||||
# the filesystem we're copying to is squashed or doesn't support chown
|
||||
# then we shouldn't be checking permissions
|
||||
if not preserve:
|
||||
__salt__['file.check_perms'](name, ret, user, group, mode)
|
||||
except (IOError, OSError):
|
||||
return _error(
|
||||
ret, 'Failed to copy "{0}" to "{1}"'.format(source, name))
|
||||
|
|
Loading…
Add table
Reference in a new issue