Skip to content

Commit fa19159

Browse files
authored
Fix modules failing with verbosity with ansible-core:2.17 (#1640)
* switch default value of ignore_sftp_stderr from False to True in zos_copy and zos_fetch modules Signed-off-by: Ketan Kelkar <[email protected]> * add changelog fragment Signed-off-by: Ketan Kelkar <[email protected]> * restore mistakenly removed portion of docs Signed-off-by: Ketan Kelkar <[email protected]> --------- Signed-off-by: Ketan Kelkar <[email protected]>
1 parent c4a6cd6 commit fa19159

File tree

5 files changed

+25
-16
lines changed

5 files changed

+25
-16
lines changed
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
bugfixes:
2+
- zos_copy - module would fail when an internal SFTP command wrote output to
3+
stderr. Fix sets default value of existing module option `ignore_sftp_error` to True
4+
(https://github.com/ansible-collections/ibm_zos_core/pull/1640).
5+
- zos_fetch - module would fail when an internal SFTP command wrote output to
6+
stderr. Fix sets default value of existing module option `ignore_sftp_error` to True
7+
(https://github.com/ansible-collections/ibm_zos_core/pull/1640).

plugins/action/zos_copy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def run(self, tmp=None, task_vars=None):
6161
force_lock = _process_boolean(task_args.get('force_lock'), default=False)
6262
executable = _process_boolean(task_args.get('executable'), default=False)
6363
asa_text = _process_boolean(task_args.get('asa_text'), default=False)
64-
ignore_sftp_stderr = _process_boolean(task_args.get("ignore_sftp_stderr"), default=False)
64+
ignore_sftp_stderr = _process_boolean(task_args.get("ignore_sftp_stderr"), default=True)
6565
backup_name = task_args.get("backup_name", None)
6666
encoding = task_args.get("encoding", None)
6767
mode = task_args.get("mode", None)

plugins/action/zos_fetch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def run(self, tmp=None, task_vars=None):
123123
flat = _process_boolean(self._task.args.get('flat'), default=False)
124124
is_binary = _process_boolean(self._task.args.get('is_binary'))
125125
ignore_sftp_stderr = _process_boolean(
126-
self._task.args.get("ignore_sftp_stderr"), default=False
126+
self._task.args.get("ignore_sftp_stderr"), default=True
127127
)
128128
validate_checksum = _process_boolean(
129129
self._task.args.get("validate_checksum"), default=True

plugins/modules/zos_copy.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -201,18 +201,19 @@
201201
required: false
202202
ignore_sftp_stderr:
203203
description:
204-
- During data transfer through SFTP, the module fails if the SFTP command
205-
directs any content to stderr. The user is able to override this
206-
behavior by setting this parameter to C(true). By doing so, the module
207-
would essentially ignore the stderr stream produced by SFTP and continue
208-
execution.
204+
- During data transfer through SFTP, the SFTP command directs content to
205+
stderr. By default, the module essentially ignores the stderr stream
206+
produced by SFTP and continues execution. The user is able to override
207+
this behavior by setting this parameter to C(false). By doing so, any
208+
content written to stderr is considered an error by Ansible and will
209+
have module fail.
209210
- When Ansible verbosity is set to greater than 3, either through the
210211
command line interface (CLI) using B(-vvvv) or through environment
211212
variables such as B(verbosity = 4), then this parameter will
212213
automatically be set to C(true).
213214
type: bool
214215
required: false
215-
default: false
216+
default: true
216217
version_added: "1.4.0"
217218
is_binary:
218219
description:
@@ -3822,7 +3823,7 @@ def main():
38223823
backup_name=dict(type='str'),
38233824
local_follow=dict(type='bool', default=True),
38243825
remote_src=dict(type='bool', default=False),
3825-
ignore_sftp_stderr=dict(type='bool', default=False),
3826+
ignore_sftp_stderr=dict(type='bool', default=True),
38263827
validate=dict(type='bool', default=False),
38273828
volume=dict(type='str', required=False),
38283829
dest_data_set=dict(

plugins/modules/zos_fetch.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -122,18 +122,19 @@
122122
type: str
123123
ignore_sftp_stderr:
124124
description:
125-
- During data transfer through sftp, the module fails if the sftp command
126-
directs any content to stderr. The user is able to override this
127-
behavior by setting this parameter to C(true). By doing so, the module
128-
would essentially ignore the stderr stream produced by sftp and continue
129-
execution.
125+
- During data transfer through SFTP, the SFTP command directs content to
126+
stderr. By default, the module essentially ignores the stderr stream
127+
produced by SFTP and continues execution. The user is able to override
128+
this behavior by setting this parameter to C(false). By doing so, any
129+
content written to stderr is considered an error by Ansible and will
130+
have module fail.
130131
- When Ansible verbosity is set to greater than 3, either through the
131132
command line interface (CLI) using B(-vvvv) or through environment
132133
variables such as B(verbosity = 4), then this parameter will
133134
automatically be set to C(true).
134135
type: bool
135136
required: false
136-
default: false
137+
default: true
137138
notes:
138139
- When fetching PDSE and VSAM data sets, temporary storage will be used
139140
on the remote z/OS system. After the PDSE or VSAM data set is
@@ -821,7 +822,7 @@ def run_module():
821822
use_qualifier=dict(required=False, default=False, type="bool"),
822823
validate_checksum=dict(required=False, default=True, type="bool"),
823824
encoding=dict(required=False, type="dict"),
824-
ignore_sftp_stderr=dict(type="bool", default=False, required=False),
825+
ignore_sftp_stderr=dict(type="bool", default=True, required=False),
825826
tmp_hlq=dict(required=False, type="str", default=None),
826827
)
827828
)

0 commit comments

Comments
 (0)