mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #40030 from narendraingale2/upstream2/fix_39445
Added changes for fix_39445
This commit is contained in:
commit
064f630d93
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user