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] Bugfixes for v1.3.6 #462

Merged
merged 19 commits into from
Oct 3, 2022
Merged

[Bug] [zos_copy] Bugfixes for v1.3.6 #462

merged 19 commits into from
Oct 3, 2022

Conversation

rexemin
Copy link
Collaborator

@rexemin rexemin commented Sep 23, 2022

SUMMARY

Fixes for

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

zos_copy

ADDITIONAL INFORMATION

For #411: When using mode in zos_copy and copying between directories, the given permissions are applied to the destination directory and any files that were not already present in it. Preexisting files and subdirectories are left with the same permissions they had before running the module.

For #412: force was added to the arg_spec of the module.

This version of the fix is a port from the code present in 1.4.0-beta.2, except now the module only changes the permissions of the destination directory and new files inside of it, leaving alone preexisting files.
By taking Ketan's notes as a reference point, this commit does the following things:

- Adds force and mode to the arg_spec of zos_copy
- Adds encoding suboptions to the arg_spec of zos_copy, zos_fetch and zos_job_submit
- Reorders the arg_spec to match documentation for zos_backup_restore, zos_copy, zos_data_set, zos_encode, zos_fetch, zos_job_submit, zos_lineinfile, zos_mvs_raw

Co-Authored-By: ketankelkar <[email protected]>
@rexemin rexemin marked this pull request as ready for review September 30, 2022 16:34
Signed-off-by: ddimatos <[email protected]>
Signed-off-by: ddimatos <[email protected]>
Signed-off-by: ddimatos <[email protected]>
Signed-off-by: ddimatos <[email protected]>
@ddimatos
Copy link
Collaborator

ddimatos commented Oct 1, 2022

Regression success
image
Internal job log link suffix /job/zosAnsible/1213/consoleText

@ddimatos ddimatos added In Progress This issue is under review by a team member. Release Release work item labels Oct 3, 2022
@ddimatos
Copy link
Collaborator

ddimatos commented Oct 3, 2022

@rexemin - could you please look at what appears to be regression from the previous version (unless intentional) where copying a directory from src to target seems only to copy the src directory contents. We might have not proper test coverage, ill take a look later at that but wanted to note it for now.

In 1.3.5 (previous version)

    - name: Copy workflows directory and its contents to directory /u/d020216/products/zosmf
      zos_copy:
        src: /tmp/workflows
        dest: /u/test/products/zosmf
        mode: '0644'
        group: 'OMVSGRP'
        owner: 'OMVSADM'
        validate: true
        ignore_sftp_stderr: true
        force: true
      register: file_output

Yields this a directory workflows/ under path /u/test/products/zosmf :

# ls /u/test/products/zosmf
workflows

In this PR (1.3.6) only the contents are copied into /u/test/products/zosmf

 ls /u/test/products/zosmf
flow-1.xml  flow-2.xml  flow-3.xml  flow-4.xml

@ddimatos
Copy link
Collaborator

ddimatos commented Oct 3, 2022

A new pull request will be performed for a new zos_copy module enhancement that will support directory copies as well, given this was the intended design at the time and all test cases passed, there is no reason to post pone this merge.

Copy link
Collaborator

@ddimatos ddimatos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, lots of good work here, I am going to merge it and as we discussed a new PR and issue to support copying directories as well for zos_copy module.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
In Progress This issue is under review by a team member. Release Release work item
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug][zos_copy] When src is a directory and dest is a directory, if mode is set they are ignored
2 participants