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

Bugfix/619/v1.4.1/zos copy mode fix #742

Merged

Conversation

AndreMarcel99
Copy link
Collaborator

@AndreMarcel99 AndreMarcel99 commented Apr 17, 2023

SUMMARY

Mode set for files is applied to destination directory by change the logic of changing files

Fixed #619

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

Add logic if to verify the destiny folder to copy to only change mode to files not folder.

ADDITIONAL INFORMATION

When the only and last file of the copy is a folder does not apply the change of mode with and if statement.

The PR in dev pass without test case, more than playbook results.

@AndreMarcel99 AndreMarcel99 changed the base branch from dev to suppor/v1.4.1-releas-tasks April 17, 2023 22:06
@fernandofloresg fernandofloresg marked this pull request as draft April 17, 2023 22:10
@AndreMarcel99
Copy link
Collaborator Author

The playbook as:

hosts : zvm
collections :

ibm.ibm_zos_core
gather_facts: no
vars:
ZOAU: "/zoau/v1.2.2"
PYZ: "/python2/usr/lpp/IBM/cyp/v3r2/pyz"
source: ./tests/
destt: /test/
environment: "{{ environment_vars }}"
tasks:

name: Delete al files inside folder dest
shell:
cmd: rm -r {{ destt }}

name: Create dest folder
shell:
cmd: mkdir {{ destt }}
register: result

name: Adjust mode of dest folder
shell:
cmd: chmod 755 {{ destt }}
register: result

name: Verify mode of destiny
shell:
cmd: ls -la {{ destt }}
register: result

name: Response
debug:
msg: "{{ result }}"

name: Copy remote text files zos_copy.
zos_copy:
src: "{{ source }}"
dest: "{{ destt }}"
mode: 644
force: true
remote_src: false

name: Response zos_copy
debug:
msg: "{{ result }}"

name: See permisions on dest
shell:
cmd: ls -la {{ destt }}
register: result

name: Response permissions after
debug:
msg: "{{ result }}"
This is the results before the change
Captura de pantalla 2023-04-17 a la(s) 16 10 43

After:
Captura de pantalla 2023-04-17 a la(s) 16 11 19

@fernandofloresg fernandofloresg force-pushed the suppor/v1.4.1-releas-tasks branch 2 times, most recently from b0adee0 to fd9a646 Compare April 18, 2023 16:31
@AndreMarcel99 AndreMarcel99 force-pushed the bugfix/619/v1.4.1/zos_copy_mode_fix branch from 44bb156 to 7d3ddf5 Compare April 18, 2023 16:34
@fernandofloresg
Copy link
Collaborator

There was some unintended commits added at some point but were cleaned hence the forced pushes.

captura_de_pantalla_2023-04-18_a_la_s__11 18 03

@fernandofloresg fernandofloresg added the Bug Something isn't working as designed. label Apr 18, 2023
@fernandofloresg fernandofloresg marked this pull request as ready for review April 18, 2023 17:45
Copy link
Collaborator

@fernandofloresg fernandofloresg left a comment

Choose a reason for hiding this comment

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

LGTM.

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 good to me, and as I understand it we have existing tests cases for this so no needed test case was added. Thank you.

@ddimatos ddimatos merged commit ae49a2c into suppor/v1.4.1-releas-tasks Apr 18, 2023
ddimatos added a commit that referenced this pull request Apr 19, 2023
* Correct version in meta.yml

* Update copyright year in readme

* Add correct year in zos_copy copyright

* Add correct year in zos_operator copyright

* Added correct year in zos_job_query copyright

* Add changelog fragment for version

* Generated changelog

* Add release notes

* Updated module docs based on module-doc

* Bugfix/619/v1.4.1/zos copy mode fix (#742)

* Add to work as comunity module

* Add changelog

---------

Co-authored-by: Andre Marcel Gutierrez Benitez <andre@MacBook-Pro-de-Andre-2.local>

* Added contributor to galaxy.yml

* Updated changelog

* Updated release notes

* Update readme to include which versions of Ansible are supported

Signed-off-by: ddimatos <dimatos@gmail.com>

* update release notes

Signed-off-by: ddimatos <dimatos@gmail.com>

* update runtime to include all of 2.14

Signed-off-by: ddimatos <dimatos@gmail.com>

* Fix galaxy-importer issue

---------

Signed-off-by: ddimatos <dimatos@gmail.com>
Co-authored-by: André Marcel Gutiérrez Benítez <68956970+AndreMarcel99@users.noreply.github.com>
Co-authored-by: Andre Marcel Gutierrez Benitez <andre@MacBook-Pro-de-Andre-2.local>
Co-authored-by: ddimatos <dimatos@gmail.com>
@AndreMarcel99 AndreMarcel99 deleted the bugfix/619/v1.4.1/zos_copy_mode_fix branch May 11, 2023 21:55
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug] [zos_copy] Mode set for files is applied to destination directory
3 participants