Skip to content

Commit 67ff6f4

Browse files
[enabler][zos_copy]Add_error_message (#1821)
* Add enhance error message * Add fragment * Update plugins/modules/zos_copy.py Co-authored-by: Fernando Flores <[email protected]> * Update 1821-Add_error_message.yml * Update zos_copy.py --------- Co-authored-by: Fernando Flores <[email protected]>
1 parent 1c64254 commit 67ff6f4

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
minor_changes:
2+
- zos_copy - Adds error message when a PDS/E source member does not exist or is not cataloged.
3+
(https://github.com/ansible-collections/ibm_zos_core/pull/1821).

plugins/modules/zos_copy.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3305,6 +3305,13 @@ def run_module(module, arg_def):
33053305
raw_src = src
33063306
raw_dest = dest
33073307

3308+
# Validation for copy from a member
3309+
if src_member:
3310+
if not (data_set.DataSet.data_set_member_exists(src)):
3311+
module.fail_json(msg="Unable to copy. Source member {0} does not exist or is not cataloged.".format(
3312+
data_set.extract_member_name(src)
3313+
))
3314+
33083315
# Implementing the new MVSDataSet class by masking the values of
33093316
# src/raw_src and dest/raw_dest.
33103317
if is_mvs_src:

0 commit comments

Comments
 (0)