Skip to content

Commit 215033d

Browse files
Staging v1.7.0 beta.2 (#939)
* Enhancement/866 archive (#930) * Added action plugin zos_unarchive * Added zos_archive changes * Added zos_unarchive changes * Added zos_archive tests changes * Added test zos_unarchive changes * Added zos_archive changes * fixed pep8 issues * Changed source to src in docs * Added correct copyright year * Updated docs * Added changelog fragments * Updated docs * Updated galaxy.yml * Updated meta * Updated docs * Added zos_gather_facts rst * Added changelog * Added release notes * Changed variable name to avoid shadowing import * Delete 930-archive-post-beta.yml * Delete v1.7.0-beta.2_summary.yml
1 parent 1b67321 commit 215033d

File tree

12 files changed

+297
-89
lines changed

12 files changed

+297
-89
lines changed

CHANGELOG.rst

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,31 @@ ibm.ibm_zos_core Release Notes
55
.. contents:: Topics
66

77

8+
v1.7.0-beta.2
9+
=============
10+
11+
Release Summary
12+
---------------
13+
14+
Release Date: '2023-08-21'
15+
This changelog describes all changes made to the modules and plugins included
16+
in this collection. The release date is the date the changelog is created.
17+
For additional details such as required dependencies and availability review
18+
the collections `release notes <https://ibm.github.io/z_ansible_collections_doc/ibm_zos_core/docs/source/release_notes.html>`__
19+
20+
Minor Changes
21+
-------------
22+
23+
- zos_archive - If destination data set space is not provided then the module computes it based on the src list and/or expanded src list based on pattern provided. (https://github.com/ansible-collections/ibm_zos_core/pull/930).
24+
- zos_archive - When xmit faces a space error in xmit operation because of dest or log data set are filled raises an appropriate error hint. (https://github.com/ansible-collections/ibm_zos_core/pull/930).
25+
- zos_unarchive - When copying to remote fails now a proper error message is displayed. (https://github.com/ansible-collections/ibm_zos_core/pull/930).
26+
- zos_unarchive - When copying to remote if space_primary is not defined, then is defaulted to 5M. (https://github.com/ansible-collections/ibm_zos_core/pull/930).
27+
28+
Bugfixes
29+
--------
30+
31+
- zos_archive - Module did not return the proper src state after archiving. Fix now displays the status of the src after the operation. (https://github.com/ansible-collections/ibm_zos_core/pull/930).
32+
833
v1.7.0-beta.1
934
=============
1035

changelogs/.plugin-cache.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,4 +126,4 @@ plugins:
126126
strategy: {}
127127
test: {}
128128
vars: {}
129-
version: 1.7.0-beta.1
129+
version: 1.7.0-beta.2

changelogs/changelog.yaml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -981,3 +981,31 @@ releases:
981981
name: zos_unarchive
982982
namespace: ''
983983
release_date: '2023-07-26'
984+
1.7.0-beta.2:
985+
changes:
986+
bugfixes:
987+
- zos_archive - Module did not return the proper src state after archiving.
988+
Fix now displays the status of the src after the operation. (https://github.com/ansible-collections/ibm_zos_core/pull/930).
989+
minor_changes:
990+
- zos_archive - If destination data set space is not provided then the module
991+
computes it based on the src list and/or expanded src list based on pattern
992+
provided. (https://github.com/ansible-collections/ibm_zos_core/pull/930).
993+
- zos_archive - When xmit faces a space error in xmit operation because of dest
994+
or log data set are filled raises an appropriate error hint. (https://github.com/ansible-collections/ibm_zos_core/pull/930).
995+
- zos_unarchive - When copying to remote fails now a proper error message is
996+
displayed. (https://github.com/ansible-collections/ibm_zos_core/pull/930).
997+
- zos_unarchive - When copying to remote if space_primary is not defined, then
998+
is defaulted to 5M. (https://github.com/ansible-collections/ibm_zos_core/pull/930).
999+
release_summary: 'Release Date: ''2023-08-21''
1000+
1001+
This changelog describes all changes made to the modules and plugins included
1002+
1003+
in this collection. The release date is the date the changelog is created.
1004+
1005+
For additional details such as required dependencies and availability review
1006+
1007+
the collections `release notes <https://ibm.github.io/z_ansible_collections_doc/ibm_zos_core/docs/source/release_notes.html>`__'
1008+
fragments:
1009+
- 930-archive-post-beta.yml
1010+
- v1.7.0-beta.2_summary.yml
1011+
release_date: '2023-08-21'

docs/source/modules/zos_archive.rst

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,14 +112,20 @@ dest
112112

113113
If *dest* is a nonexistent USS file, it will be created.
114114

115+
If *dest* is an existing file or data set and *force=true*, the existing *dest* will be deleted and recreated with attributes defined in the *dest_data_set* option or computed by the module.
116+
117+
If *dest* is an existing file or data set and *force=false* or not specified, the module exits with a note to the user.
118+
115119
Destination data set attributes can be set using *dest_data_set*.
116120

121+
Destination data set space will be calculated based on space of source data sets provided and/or found by expanding the pattern name. Calculating space can impact module performance. Specifying space attributes in the *dest_data_set* option will improve performance.
122+
117123
| **required**: True
118124
| **type**: str
119125
120126

121127
exclude
122-
Remote absolute path, glob, or list of paths, globs or data set name patterns for the file, files or data sets to exclude from path list and glob expansion.
128+
Remote absolute path, glob, or list of paths, globs or data set name patterns for the file, files or data sets to exclude from src list and glob expansion.
123129

124130
Patterns (wildcards) can contain one of the following, `?`, `*`.
125131

@@ -152,7 +158,7 @@ mode
152158

153159
The mode may also be specified as a symbolic mode (for example, 'u+rwx' or 'u=rw,g=r,o=r') or a special string 'preserve'.
154160

155-
*mode=preserve* means that the file will be given the same permissions as the source file.
161+
*mode=preserve* means that the file will be given the same permissions as the src file.
156162

157163
| **required**: False
158164
| **type**: str
@@ -170,7 +176,7 @@ owner
170176
171177

172178
remove
173-
Remove any added source files , trees or data sets after module `zos_archive <./zos_archive.html>`_ adds them to the archive. Source files, trees and data sets are identified with option *path*.
179+
Remove any added source files , trees or data sets after module `zos_archive <./zos_archive.html>`_ adds them to the archive. Source files, trees and data sets are identified with option *src*.
174180

175181
| **required**: False
176182
| **type**: bool
@@ -387,6 +393,8 @@ Notes
387393

388394
When packing and using ``use_adrdssu`` flag the module will take up to two times the space indicated in ``dest_data_set``.
389395

396+
tar, zip, bz2 and pax are archived using python ``tarfile`` library which uses the latest version available for each format, for compatibility when opening from system make sure to use the latest available version for the intended format.
397+
390398

391399

392400
See Also
@@ -425,7 +433,7 @@ dest_state
425433

426434
``compress`` when the file is compressed, but not an archive.
427435

428-
``incomplete`` when the file is an archive, but some files under *path* were not found.
436+
``incomplete`` when the file is an archive, but some files under *src* were not found.
429437

430438
| **returned**: success
431439
| **type**: str

docs/source/modules/zos_gather_facts.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ Synopsis
2222
- Note, the module will fail fast if any unsupported options are provided. This is done to raise awareness of a failure in an automation setting.
2323

2424

25+
Requirements
26+
------------
27+
28+
- ZOAU 1.2.1 or later.
29+
2530

2631

2732

docs/source/release_notes.rst

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,39 @@
66
Releases
77
========
88

9+
Version 1.7.0-beta.2
10+
====================
11+
12+
Minor Changes
13+
-------------
14+
- ``zos_archive``
15+
16+
- When xmit faces a space error in xmit operation because of dest or log data set being filled raises an appropriate error hint.
17+
- If destination data set space is not provided then the module computes it based on the src list and/or expanded src list based on pattern provided.
18+
19+
- ``zos_unarchive``
20+
21+
- When copying to remote fails now a proper error message is displayed.
22+
- When copying to remote if space_primary is not defined, then is defaulted to 5M.
23+
24+
Bugfixes
25+
--------
26+
- ``zos_archive`` - Module did not return the proper src state after archiving. Fix now displays the status of the src after the operation.
27+
28+
Availability
29+
------------
30+
31+
* `Galaxy`_
32+
* `GitHub`_
33+
34+
Reference
35+
---------
36+
37+
* Supported by `z/OS V2R3`_ or later
38+
* Supported by the `z/OS® shell`_
39+
* Supported by `IBM Open Enterprise SDK for Python`_ `3.9`_ - `3.11`_
40+
* Supported by IBM `Z Open Automation Utilities 1.2.3`_ (or later) but prior to version 1.3.
41+
942
Version 1.7.0-beta.1
1043
====================
1144

galaxy.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ namespace: ibm
66
name: ibm_zos_core
77

88
# The collection version
9-
version: 1.7.0-beta.1
9+
version: 1.7.0-beta.2
1010

1111
# Collection README file
1212
readme: README.md
@@ -19,7 +19,7 @@ authors:
1919
- Ivan Moreno <[email protected]>
2020
- Oscar Fernando Flores Garcia <[email protected]>
2121
- Jenny Huang <[email protected]>
22-
- Marcel Guitierrez <[email protected]>
22+
- Marcel Gutierrez <[email protected]>
2323

2424
# Description
2525
description: The IBM z/OS core collection includes connection plugins, action plugins, modules, filters and ansible-doc to automate tasks on z/OS.

meta/ibm_zos_core_meta.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: ibm_zos_core
2-
version: "1.7.0-beta.1"
2+
version: "1.7.0-beta.2"
33
managed_requirements:
44
-
55
name: "IBM Open Enterprise SDK for Python"

plugins/action/zos_unarchive.py

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,8 @@ def run(self, tmp=None, task_vars=None):
6161
format_name = format.get("name")
6262
copy_module_args = dict()
6363
dest_data_set = format.get("dest_data_set")
64+
if dest_data_set is None:
65+
dest_data_set = dict()
6466
dest = ""
6567
if source.startswith('~'):
6668
source = os.path.expanduser(source)
@@ -80,14 +82,12 @@ def run(self, tmp=None, task_vars=None):
8082
task_vars=task_vars,
8183
)
8284
dest = cmd_res.get("stdout")
83-
if dest_data_set is None:
84-
if format_name == 'terse':
85-
dest_data_set = dict(type='SEQ', record_format='FB', record_length=1024)
86-
if format_name == 'xmit':
87-
dest_data_set = dict(type='SEQ', record_format='FB', record_length=80)
88-
else:
89-
# Raise unsupported format name
90-
None
85+
if dest_data_set.get("space_primary") is None:
86+
dest_data_set.update(space_primary=5, space_type="M")
87+
if format_name == 'terse':
88+
dest_data_set.update(type='SEQ', record_format='FB', record_length=1024)
89+
if format_name == 'xmit':
90+
dest_data_set.update(type='SEQ', record_format='FB', record_length=80)
9191

9292
copy_module_args.update(
9393
dict(
@@ -107,15 +107,17 @@ def run(self, tmp=None, task_vars=None):
107107
templar=self._templar,
108108
shared_loader_obj=self._shared_loader_obj)
109109
result.update(zos_copy_action_module.run(task_vars=task_vars))
110-
111-
module_args["src"] = dest
112-
display.vvv(u"Copy args {0}".format(result), host=self._play_context.remote_addr)
113-
114-
result.update(
115-
self._execute_module(
116-
module_name="ibm.ibm_zos_core.zos_unarchive",
117-
module_args=module_args,
118-
task_vars=task_vars,
110+
display.vvv(u"Copy result {0}".format(result), host=self._play_context.remote_addr)
111+
if result.get("msg") is None:
112+
module_args["src"] = dest
113+
114+
result.update(
115+
self._execute_module(
116+
module_name="ibm.ibm_zos_core.zos_unarchive",
117+
module_args=module_args,
118+
task_vars=task_vars,
119+
)
119120
)
120-
)
121+
else:
122+
result.update(dict(failed=True))
121123
return result

0 commit comments

Comments
 (0)