|
141 | 141 | description:
|
142 | 142 | - The format of the data set. (e.g C(FB))
|
143 | 143 | - Choices are case-insensitive.
|
| 144 | + - When I(type=KSDS), I(type=ESDS), I(type=RRDS), I(type=LDS) or I(type=ZFS) |
| 145 | + then I(record_format=None), these types do not have a default |
| 146 | + I(record_format). |
144 | 147 | required: false
|
145 | 148 | choices:
|
146 | 149 | - FB
|
|
149 | 152 | - VBA
|
150 | 153 | - U
|
151 | 154 | type: str
|
| 155 | + default: FB |
152 | 156 | sms_storage_class:
|
153 | 157 | description:
|
154 | 158 | - The storage class for an SMS-managed dataset.
|
|
365 | 369 | description:
|
366 | 370 | - The format of the data set. (e.g C(FB))
|
367 | 371 | - Choices are case-insensitive.
|
| 372 | + - When I(type=KSDS), I(type=ESDS), I(type=RRDS), I(type=LDS) or |
| 373 | + I(type=ZFS) then I(record_format=None), these types do not have a |
| 374 | + default I(record_format). |
368 | 375 | required: false
|
369 | 376 | choices:
|
370 | 377 | - FB
|
|
373 | 380 | - VBA
|
374 | 381 | - U
|
375 | 382 | type: str
|
| 383 | + default: FB |
376 | 384 | sms_storage_class:
|
377 | 385 | description:
|
378 | 386 | - The storage class for an SMS-managed dataset.
|
|
629 | 637 | "U": 0,
|
630 | 638 | }
|
631 | 639 |
|
| 640 | +DATA_SET_TYPES_VSAM = [ |
| 641 | + "KSDS", |
| 642 | + "ESDS", |
| 643 | + "RRDS", |
| 644 | + "LDS", |
| 645 | + "ZFS", |
| 646 | +] |
| 647 | + |
632 | 648 | # ------------- Functions to validate arguments ------------- #
|
633 | 649 |
|
634 | 650 |
|
@@ -1118,7 +1134,7 @@ def run_module():
|
1118 | 1134 | space_type=dict(type="str", required=False, default="M"),
|
1119 | 1135 | space_primary=dict(type="int", required=False, aliases=["size"], default=5),
|
1120 | 1136 | space_secondary=dict(type="int", required=False, default=3),
|
1121 |
| - record_format=dict(type="str", required=False, aliases=["format"]), |
| 1137 | + record_format=dict(type="str", required=False, aliases=["format"], default="FB"), |
1122 | 1138 | sms_management_class=dict(type="str", required=False),
|
1123 | 1139 | # I know this alias is odd, ZOAU used to document they supported
|
1124 | 1140 | # SMS data class when they were actually passing as storage class
|
@@ -1162,7 +1178,7 @@ def run_module():
|
1162 | 1178 | space_type=dict(type="str", required=False, default="M"),
|
1163 | 1179 | space_primary=dict(type="raw", required=False, aliases=["size"], default=5),
|
1164 | 1180 | space_secondary=dict(type="int", required=False, default=3),
|
1165 |
| - record_format=dict(type="str", required=False, aliases=["format"]), |
| 1181 | + record_format=dict(type="str", required=False, aliases=["format"], default="FB"), |
1166 | 1182 | sms_management_class=dict(type="str", required=False),
|
1167 | 1183 | # I know this alias is odd, ZOAU used to document they supported
|
1168 | 1184 | # SMS data class when they were actually passing as storage class
|
@@ -1202,6 +1218,32 @@ def run_module():
|
1202 | 1218 |
|
1203 | 1219 | module = AnsibleModule(argument_spec=module_args, supports_check_mode=True)
|
1204 | 1220 |
|
| 1221 | + # This evaluation will always occur as a result of the limitation on the |
| 1222 | + # better arg parser, this will serve as a solution for now and ensure |
| 1223 | + # the non-batch and batch arguments are correctly set |
| 1224 | + if module.params.get("batch") is not None: |
| 1225 | + for entry in module.params.get("batch"): |
| 1226 | + if entry.get('type') is not None and entry.get("type").upper() in DATA_SET_TYPES_VSAM: |
| 1227 | + entry["record_format"] = None |
| 1228 | + if module.params.get("type") is not None: |
| 1229 | + module.params["type"] = None |
| 1230 | + if module.params.get("state") is not None: |
| 1231 | + module.params["state"] = None |
| 1232 | + if module.params.get("space_type") is not None: |
| 1233 | + module.params["space_type"] = None |
| 1234 | + if module.params.get("space_primary") is not None: |
| 1235 | + module.params["space_primary"] = None |
| 1236 | + if module.params.get("space_secondary") is not None: |
| 1237 | + module.params["space_secondary"] = None |
| 1238 | + if module.params.get("replace") is not None: |
| 1239 | + module.params["replace"] = None |
| 1240 | + if module.params.get("record_format") is not None: |
| 1241 | + module.params["record_format"] = None |
| 1242 | + elif module.params.get("type") is not None: |
| 1243 | + if module.params.get("type").upper() in DATA_SET_TYPES_VSAM: |
| 1244 | + # For VSAM types set the value to nothing and let the code manage it |
| 1245 | + module.params["record_format"] = None |
| 1246 | + |
1205 | 1247 | if not module.check_mode:
|
1206 | 1248 | try:
|
1207 | 1249 | # Update the dictionary for use by better arg parser by adding the
|
|
0 commit comments