Added changes for fix_39445

This commit is contained in:
Narendra Ingale 2017-03-15 10:22:47 +05:30 committed by rallytime
parent 11d2f5abec
commit 52b3d986b5

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.chown'](os.path.join(root, dir_), user, group)
for file_ in files:
__salt__['file.chown'](os.path.join(root, file_), user, group)
else:
shutil.copy(source, name)
ret['changes'] = {name: source}