Merge pull request #40030 from narendraingale2/upstream2/fix_39445

Added changes for fix_39445
This commit is contained in:
Mike Place 2017-03-17 12:05:46 -06:00 committed by GitHub
commit 064f630d93

View File

@ -5138,6 +5138,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}