mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #40231 from rallytime/bp-40030
Back-port #40030 to 2016.11
This commit is contained in:
commit
c40376250f
@ -4723,6 +4723,11 @@ def copy(
|
|||||||
try:
|
try:
|
||||||
if os.path.isdir(source):
|
if os.path.isdir(source):
|
||||||
shutil.copytree(source, name, symlinks=True)
|
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:
|
else:
|
||||||
shutil.copy(source, name)
|
shutil.copy(source, name)
|
||||||
ret['changes'] = {name: source}
|
ret['changes'] = {name: source}
|
||||||
|
Loading…
Reference in New Issue
Block a user