Skip to content

Commit 3a43237

Browse files
ddimatosblakeinate
andauthored
Release v1.2.1 (#188)
* Update and support or python 2 (#187) * fix python2 incompatibility * add python2 support, fix lint issue * remove Path library dependency for python2 support * remove fullmatch dependency from zos_copy * update encode utility for python2, fix bug caused by earlier python2 update * adding asif's updates * Update docs and meta data to next version increment * Remove space, avoid pep8 rules Co-authored-by: Blake Becker <[email protected]>
1 parent a03ded2 commit 3a43237

File tree

7 files changed

+391
-230
lines changed

7 files changed

+391
-230
lines changed

docs/source/conf.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@
147147
# White list which Git tags documentation will be generated and linked into the
148148
# version selection box. This is currently a manual selection, until more
149149
# versions are released, there are no regular expressions used.
150-
scv_whitelist_tags = ('v1.0.0', 'v1.1.0$', 'v1.2.0$',)
150+
scv_whitelist_tags = ('v1.0.0', 'v1.1.0$', 'v1.2.1$',)
151151

152152
# Sort versions by one or more values. Valid values are semver, alpha, and time.
153153
# Semantic is referred to as 'semver', this would ensure our latest VRM is

docs/source/release_notes.rst

Lines changed: 64 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,70 @@
66
Releases
77
========
88

9+
Version 1.2.1
10+
=============
11+
12+
Notes
13+
-----
14+
15+
* Update required
16+
* Module changes
17+
18+
* Noteworthy Python 2.x support
19+
20+
* encode - removed TemporaryDirectory usage.
21+
* zos_copy - fixed regex support, dictionary merge operation fix
22+
* zos_fetch - fix quote import
23+
24+
* Collection changes
25+
26+
* Beginning this release, all sample playbooks previously included with the
27+
collection will be made available on the `samples repository`_. The
28+
`samples repository`_ explains the playbook concepts,
29+
discusses z/OS administration, provides links to the samples support site,
30+
blogs and other community resources.
31+
32+
* Documentation changes
33+
34+
* In this release, documentation related to playbook configuration has been
35+
migrated to the `samples repository`_. Each sample contains a README that
36+
explains what configurations must be made to run the sample playbook.
37+
38+
.. _samples repository:
39+
https://github.com/IBM/z_ansible_collections_samples/blob/master/README.md
40+
41+
Availability
42+
------------
43+
44+
* `Automation Hub`_
45+
* `Galaxy`_
46+
* `GitHub`_
47+
48+
Reference
49+
---------
50+
51+
* Supported by IBM Open Enterprise Python for z/OS: 3.8.2 or later
52+
* Supported by IBM Z Open Automation Utilities 1.0.3 PTF UI70435
53+
* Supported by z/OS V2R3
54+
* The z/OS® shell
55+
56+
Known issues
57+
------------
58+
59+
* Modules
60+
61+
* When executing programs using ``zos_mvs_raw``, you may encounter errors
62+
that originate in the programs implementation. Two such known issues are
63+
noted below of which one has been addressed with an APAR.
64+
65+
#. ``zos_mvs_raw`` module execution fails when invoking
66+
Database Image Copy 2 Utility or Database Recovery Utility in conjunction
67+
with FlashCopy or Fast Replication.
68+
#. ``zos_mvs_raw`` module execution fails when invoking DFSRRC00 with parm
69+
"UPB,PRECOMP", "UPB, POSTCOMP" or "UPB,PRECOMP,POSTCOMP". This issue is
70+
addressed by APAR PH28089.
71+
72+
973
Version 1.2.0
1074
=============
1175

@@ -33,7 +97,6 @@ Notes
3397
Availability
3498
------------
3599

36-
* `Automation Hub`_
37100
* `Galaxy`_
38101
* `GitHub`_
39102

galaxy.yml

Lines changed: 1 addition & 1 deletion
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.2.0
9+
version: 1.2.1
1010

1111
# Collection README file
1212
readme: README.md

plugins/module_utils/encode.py

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
__metaclass__ = type
88

9-
from tempfile import NamedTemporaryFile, TemporaryDirectory, mkstemp
9+
from tempfile import NamedTemporaryFile, mkstemp, mkdtemp
1010
from math import floor, ceil
1111
from os import path, walk, makedirs, unlink
1212
from ansible.module_utils.six import PY3
@@ -23,9 +23,7 @@
2323
from ansible_collections.ibm.ibm_zos_core.plugins.module_utils.better_arg_parser import (
2424
BetterArgParser,
2525
)
26-
from ansible_collections.ibm.ibm_zos_core.plugins.module_utils import (
27-
copy, system
28-
)
26+
from ansible_collections.ibm.ibm_zos_core.plugins.module_utils import copy, system
2927
from ansible_collections.ibm.ibm_zos_core.plugins.module_utils.ansible_module import (
3028
AnsibleModuleHelper,
3129
)
@@ -81,25 +79,33 @@ def __init__(self):
8179
self.module = AnsibleModuleHelper(argument_spec={})
8280

8381
def _validate_data_set_name(self, ds):
84-
arg_defs = dict(ds=dict(arg_type="data_set"),)
82+
arg_defs = dict(
83+
ds=dict(arg_type="data_set"),
84+
)
8585
parser = BetterArgParser(arg_defs)
8686
parsed_args = parser.parse_args({"ds": ds})
8787
return parsed_args.get("ds")
8888

8989
def _validate_path(self, path):
90-
arg_defs = dict(path=dict(arg_type="path"),)
90+
arg_defs = dict(
91+
path=dict(arg_type="path"),
92+
)
9193
parser = BetterArgParser(arg_defs)
9294
parsed_args = parser.parse_args({"path": path})
9395
return parsed_args.get("path")
9496

9597
def _validate_data_set_or_path(self, path):
96-
arg_defs = dict(path=dict(arg_type="data_set_or_path"),)
98+
arg_defs = dict(
99+
path=dict(arg_type="data_set_or_path"),
100+
)
97101
parser = BetterArgParser(arg_defs)
98102
parsed_args = parser.parse_args({"path": path})
99103
return parsed_args.get("path")
100104

101105
def _validate_encoding(self, encoding):
102-
arg_defs = dict(encoding=dict(arg_type="encoding"),)
106+
arg_defs = dict(
107+
encoding=dict(arg_type="encoding"),
108+
)
103109
parser = BetterArgParser(arg_defs)
104110
parsed_args = parser.parse_args({"encoding": encoding})
105111
return parsed_args.get("encoding")
@@ -281,7 +287,7 @@ def uss_convert_encoding(self, src, dest, from_code, to_code):
281287
return convert_rc
282288

283289
def uss_convert_encoding_prev(self, src, dest, from_code, to_code):
284-
""" For multiple files conversion, such as a USS path or MVS PDS data set,
290+
"""For multiple files conversion, such as a USS path or MVS PDS data set,
285291
use this method to split then do the conversion
286292
287293
Arguments:
@@ -378,8 +384,7 @@ def mvs_convert_encoding(
378384
temp_src = temp_src_fo.name
379385
rc, out, err = copy.copy_ps2uss(src, temp_src)
380386
if src_type == "PO":
381-
temp_src_fo = TemporaryDirectory()
382-
temp_src = temp_src_fo.name
387+
temp_src = mkdtemp()
383388
rc, out, err = copy.copy_pds2uss(src, temp_src)
384389
if src_type == "VSAM":
385390
reclen, space_u = self.listdsi_data_set(src.upper())
@@ -392,8 +397,7 @@ def mvs_convert_encoding(
392397
temp_dest_fo = NamedTemporaryFile()
393398
temp_dest = temp_dest_fo.name
394399
if dest_type == "PO":
395-
temp_dest_fo = TemporaryDirectory()
396-
temp_dest = temp_dest_fo.name
400+
temp_dest = mkdtemp()
397401
rc = self.uss_convert_encoding_prev(temp_src, temp_dest, from_code, to_code)
398402
if rc:
399403
if not dest_type:
@@ -419,6 +423,13 @@ def mvs_convert_encoding(
419423
finally:
420424
if temp_ps:
421425
Datasets.delete(temp_ps)
426+
if temp_src and temp_src != src:
427+
if os.path.isdir(temp_src):
428+
shutil.rmtree(temp_src)
429+
if temp_dest and temp_dest != dest:
430+
if os.path.isdir(temp_dest):
431+
shutil.rmtree(temp_dest)
432+
422433
return convert_rc
423434

424435

plugins/module_utils/system.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ def run_command(args, stdin=None, **kwargs):
9393
err = "'args' must be list or string"
9494
return rc, out, err
9595

96-
if isinstance(args, text_type):
96+
if isinstance(args, (text_type, str)):
9797
if PY2:
9898
args = to_bytes(args, errors='surrogate_or_strict')
9999
elif PY3:

0 commit comments

Comments
 (0)