Skip to content

Commit e791062

Browse files
AndreMarcel99Andre Marcel Gutierrez Benitez
andauthored
Solve problem 619 about set mode on dest file (#746)
* Solve problem 619 about set mode on dest file * Add fragment of 746 PR --------- Co-authored-by: Andre Marcel Gutierrez Benitez <andre@MacBook-Pro-de-Andre-2.local>
1 parent 7b96023 commit e791062

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
minor_changes:
2+
- zos_copy - Fixed a bug where the module would change the mode for a directory when copying into it the contents of another.
3+
(https://github.com/ansible-collections/ibm_zos_core/pull/746)

plugins/modules/zos_copy.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1062,8 +1062,8 @@ def copy_to_uss(
10621062
group = self.common_file_args.get("group")
10631063
owner = self.common_file_args.get("owner")
10641064
if mode is not None:
1065-
self.module.set_mode_if_different(dest, mode, False)
1066-
1065+
if not os.path.isdir(dest):
1066+
self.module.set_mode_if_different(dest, mode, False)
10671067
if changed_files:
10681068
for filepath in changed_files:
10691069
self.module.set_mode_if_different(os.path.join(dest, filepath), mode, False)

0 commit comments

Comments
 (0)