Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] [zos_copy] Omitting a traling '/' on a source directory does not copy the directory itself #496

Closed
rexemin opened this issue Oct 3, 2022 · 1 comment · Fixed by #306 or #528
Assignees
Labels
Bug Something isn't working as designed. In Plan Issue has been accepted put into a planned release In Progress This issue is under review by a team member.

Comments

@rexemin
Copy link
Collaborator

rexemin commented Oct 3, 2022

Bug description

When copying a source directory to another directory, if omitting a trailing '/' on its path, the directory does not get copied into dest, just the contents of it. The built-in copy module behaves differently depending on how the src path is specified (documentation here):

If path is a directory, it is copied recursively. In this case, if path ends with “/”, only inside contents of that directory are copied to destination. Otherwise, if it does not end with “/”, the directory itself with all contents is copied. This behavior is similar to the rsync command line tool.

This issue is to align the behavior present in zos_copy with what the built-in module does.

Playbook verbosity output

No response

Contents of ansible.cfg

No response

Contents of the inventory

No response

Contents of group_vars or host_vars

No response

Ansible version

ansible [core 2.11.12] 
  config file = /Users/iamorenosoto/Documents/IBM/Development/nazare/9389/ansible.cfg
  configured module search path = ['/Users/iamorenosoto/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /Users/iamorenosoto/.pyenv/versions/3.8.12/envs/nazare-9389/lib/python3.8/site-packages/ansible
  ansible collection location = /Users/iamorenosoto/.ansible/collections:/usr/share/ansible/collections
  executable location = /Users/iamorenosoto/.pyenv/versions/nazare-9389/bin/ansible
  python version = 3.8.12 (default, Jan 17 2022, 16:02:56) [Clang 13.0.0 (clang-1300.0.27.3)]
  jinja version = 3.1.2
  libyaml = True

IBM z/OS Ansible core Version

v1.3.6

IBM ZOAU version

v1.2.0

z/OS version

2.3

Ansible module

zos_copy

@rexemin rexemin added Bug Something isn't working as designed. In Progress This issue is under review by a team member. labels Oct 3, 2022
@rexemin rexemin added this to the Bugs milestone Oct 3, 2022
@rexemin rexemin self-assigned this Oct 3, 2022
@rexemin rexemin moved this to 🏗 In progress in IBM Ansible z/OS Core Collection Oct 3, 2022
@ddimatos ddimatos added the In Plan Issue has been accepted put into a planned release label Oct 4, 2022
@rexemin rexemin linked a pull request Oct 6, 2022 that will close this issue
@rexemin rexemin moved this from 🏗 In progress to 🔍 Validation in IBM Ansible z/OS Core Collection Oct 6, 2022
@ddimatos
Copy link
Collaborator

ddimatos commented Oct 7, 2022

Good we leave this work item in Validation mode so we are sure to include it in 1.4.0-beta.2, otherwise this work item was completed (and very well so :) )

rexemin added a commit that referenced this issue Oct 12, 2022
This was linked to pull requests Oct 12, 2022
ddimatos pushed a commit that referenced this issue Oct 13, 2022
* Ported bugfix for #496 from v1.3.6

* Removed unused variables and added mode to arg_spec

The variables src_ds_vol, src_has_subdirs and alloc_size are not used anymore by the module, so I removed them to fix linting issues.

* Updated zos_copy's documentation

* Updated ignored sanity tests for zos_copy

* Update ignore-2.9.txt
@rexemin rexemin moved this from 🔍 Validation to ✅ Done in IBM Ansible z/OS Core Collection Oct 14, 2022
@rexemin rexemin closed this as completed Nov 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working as designed. In Plan Issue has been accepted put into a planned release In Progress This issue is under review by a team member.
Projects
2 participants