Using lchown insted of chown.

This commit is contained in:
Narendra Ingale 2017-03-15 17:00:58 +05:30 committed by rallytime
parent 52b3d986b5
commit 4d1c687cbd

View file

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