Merge pull request #40231 from rallytime/bp-40030

Back-port #40030 to 2016.11
This commit is contained in:
Mike Place 2017-03-22 17:14:40 -06:00 committed by GitHub
commit c40376250f

View File

@ -4723,6 +4723,11 @@ def copy(
try:
if os.path.isdir(source):
shutil.copytree(source, name, symlinks=True)
for root, dirs, files in os.walk(name):
for dir_ in dirs:
__salt__['file.lchown'](os.path.join(root, dir_), user, group)
for file_ in files:
__salt__['file.lchown'](os.path.join(root, file_), user, group)
else:
shutil.copy(source, name)
ret['changes'] = {name: source}