191
191
"""
192
192
193
193
194
- from typing import Dict
195
194
from ansible_collections .ibm .ibm_zos_core .plugins .module_utils .better_arg_parser import (
196
195
BetterArgParser ,
197
196
)
@@ -219,116 +218,104 @@ class AnsibleAuxiliaryTempModule(DataSet):
219
218
def __init__ (self ):
220
219
super (AnsibleAuxiliaryTempModule , self ).__init__ ()
221
220
222
- def init_argument_spec (self ): # type: () -> Dict
221
+ def init_argument_spec (self ): # type: () -> dict
223
222
arg_spec = super (AnsibleAuxiliaryTempModule , self ).init_argument_spec ()
224
223
225
- arg_spec [ds_constants ["PRIMARY_SPACE_VALUE_ALIAS" ]].update (
226
- {
227
- "default" : temp_constants ["PRIMARY_SPACE_VALUE_DEFAULT" ],
228
- }
229
- )
230
- arg_spec [ds_constants ["PRIMARY_SPACE_UNIT_ALIAS" ]].update (
231
- {
232
- "default" : temp_constants ["SPACE_UNIT_DEFAULT" ],
233
- }
234
- )
235
- arg_spec [ds_constants ["TARGET_STATE_ALIAS" ]].update (
236
- {
237
- "choices" : temp_constants ["TARGET_STATE_OPTIONS" ],
238
- }
239
- )
240
- arg_spec .update (
241
- {
242
- ds_constants ["REGION_DATA_SETS_ALIAS" ]: {
243
- "type" : "dict" ,
244
- "required" : True ,
245
- "options" : {
246
- "template" : {
247
- "type" : "str" ,
248
- "required" : False ,
249
- },
250
- "dfhtemp" : {
251
- "type" : "dict" ,
252
- "required" : False ,
253
- "options" : {
254
- "dsn" : {
255
- "type" : "str" ,
256
- "required" : False ,
257
- },
224
+ arg_spec [ds_constants ["PRIMARY_SPACE_VALUE_ALIAS" ]].update ({
225
+ "default" : temp_constants ["PRIMARY_SPACE_VALUE_DEFAULT" ],
226
+ })
227
+ arg_spec [ds_constants ["PRIMARY_SPACE_UNIT_ALIAS" ]].update ({
228
+ "default" : temp_constants ["SPACE_UNIT_DEFAULT" ],
229
+ })
230
+ arg_spec [ds_constants ["TARGET_STATE_ALIAS" ]].update ({
231
+ "choices" : temp_constants ["TARGET_STATE_OPTIONS" ],
232
+ })
233
+ arg_spec .update ({
234
+ ds_constants ["REGION_DATA_SETS_ALIAS" ]: {
235
+ "type" : "dict" ,
236
+ "required" : True ,
237
+ "options" : {
238
+ "template" : {
239
+ "type" : "str" ,
240
+ "required" : False ,
241
+ },
242
+ "dfhtemp" : {
243
+ "type" : "dict" ,
244
+ "required" : False ,
245
+ "options" : {
246
+ "dsn" : {
247
+ "type" : "str" ,
248
+ "required" : False ,
258
249
},
259
250
},
260
251
},
261
252
},
262
- ds_constants [ "CICS_DATA_SETS_ALIAS" ]: {
263
- "type" : "dict" ,
264
- "required " : False ,
265
- "options " : {
266
- "template " : {
267
- "type " : "str" ,
268
- "required " : False ,
269
- } ,
270
- "sdfhload" : {
271
- "type " : "str" ,
272
- "required " : False ,
273
- } ,
253
+ },
254
+ ds_constants [ "CICS_DATA_SETS_ALIAS" ]: {
255
+ "type " : "dict" ,
256
+ "required " : False ,
257
+ "options " : {
258
+ "template " : {
259
+ "type " : "str" ,
260
+ "required" : False ,
261
+ },
262
+ "sdfhload " : {
263
+ "type " : "str" ,
264
+ "required" : False ,
274
265
},
275
266
},
276
- }
277
- )
267
+ },
268
+ } )
278
269
return arg_spec
279
270
280
- def _get_arg_defs (self ): # type: () -> Dict
271
+ def _get_arg_defs (self ): # type: () -> dict
281
272
arg_def = super (AnsibleAuxiliaryTempModule , self )._get_arg_defs ()
282
273
283
- arg_def [ds_constants ["PRIMARY_SPACE_VALUE_ALIAS" ]].update (
284
- {"default" : temp_constants ["PRIMARY_SPACE_VALUE_DEFAULT" ]}
285
- )
286
- (
287
- arg_def [ds_constants ["PRIMARY_SPACE_UNIT_ALIAS" ]].update (
288
- {"default" : temp_constants ["SPACE_UNIT_DEFAULT" ]}
289
- ),
290
- )
291
- arg_def [ds_constants ["TARGET_STATE_ALIAS" ]].update (
292
- {"choices" : temp_constants ["TARGET_STATE_OPTIONS" ]}
293
- )
294
- arg_def .update (
295
- {
296
- ds_constants ["REGION_DATA_SETS_ALIAS" ]: {
297
- "arg_type" : "dict" ,
298
- "required" : True ,
299
- "options" : {
300
- "template" : {
301
- "arg_type" : "str" ,
302
- "required" : False ,
303
- },
304
- "dfhtemp" : {
305
- "arg_type" : "dict" ,
306
- "required" : False ,
307
- "options" : {
308
- "dsn" : {
309
- "arg_type" : "data_set_base" ,
310
- "required" : False ,
311
- },
274
+ arg_def [ds_constants ["PRIMARY_SPACE_VALUE_ALIAS" ]].update ({
275
+ "default" : temp_constants ["PRIMARY_SPACE_VALUE_DEFAULT" ]
276
+ })
277
+ arg_def [ds_constants ["PRIMARY_SPACE_UNIT_ALIAS" ]].update ({
278
+ "default" : temp_constants ["SPACE_UNIT_DEFAULT" ]
279
+ })
280
+ arg_def [ds_constants ["TARGET_STATE_ALIAS" ]].update ({
281
+ "choices" : temp_constants ["TARGET_STATE_OPTIONS" ]
282
+ })
283
+ arg_def .update ({
284
+ ds_constants ["REGION_DATA_SETS_ALIAS" ]: {
285
+ "arg_type" : "dict" ,
286
+ "required" : True ,
287
+ "options" : {
288
+ "template" : {
289
+ "arg_type" : "str" ,
290
+ "required" : False ,
291
+ },
292
+ "dfhtemp" : {
293
+ "arg_type" : "dict" ,
294
+ "required" : False ,
295
+ "options" : {
296
+ "dsn" : {
297
+ "arg_type" : "data_set_base" ,
298
+ "required" : False ,
312
299
},
313
300
},
314
301
},
315
302
},
316
- ds_constants [ "CICS_DATA_SETS_ALIAS" ]: {
317
- "arg_type" : "dict" ,
318
- "required " : False ,
319
- "options " : {
320
- "template " : {
321
- "arg_type " : "str" ,
322
- "required " : False ,
323
- } ,
324
- "sdfhload" : {
325
- "arg_type " : "data_set_base" ,
326
- "required " : False ,
327
- } ,
303
+ },
304
+ ds_constants [ "CICS_DATA_SETS_ALIAS" ]: {
305
+ "arg_type " : "dict" ,
306
+ "required " : False ,
307
+ "options " : {
308
+ "template " : {
309
+ "arg_type " : "str" ,
310
+ "required" : False ,
311
+ },
312
+ "sdfhload " : {
313
+ "arg_type " : "data_set_base" ,
314
+ "required" : False ,
328
315
},
329
316
},
330
- }
331
- )
317
+ },
318
+ } )
332
319
333
320
return arg_def
334
321
@@ -354,28 +341,26 @@ def _get_data_set_size(self, result):
354
341
def validate_parameters (self ): # type: () -> None
355
342
arg_defs = self ._get_arg_defs ()
356
343
357
- result = BetterArgParser (arg_defs ).parse_args (
358
- {
359
- ds_constants ["REGION_DATA_SETS_ALIAS" ]: self ._module .params .get (
360
- ds_constants ["REGION_DATA_SETS_ALIAS" ]
361
- ),
362
- ds_constants ["CICS_DATA_SETS_ALIAS" ]: self ._module .params .get (
363
- ds_constants ["CICS_DATA_SETS_ALIAS" ]
364
- ),
365
- ds_constants ["PRIMARY_SPACE_VALUE_ALIAS" ]: self ._module .params .get (
366
- ds_constants ["PRIMARY_SPACE_VALUE_ALIAS" ]
367
- ),
368
- ds_constants ["PRIMARY_SPACE_UNIT_ALIAS" ]: self ._module .params .get (
369
- ds_constants ["PRIMARY_SPACE_UNIT_ALIAS" ]
370
- ),
371
- ds_constants ["DATASET_LOCATION_ALIAS" ]: self ._module .params .get (
372
- ds_constants ["DATASET_LOCATION_ALIAS" ]
373
- ),
374
- ds_constants ["TARGET_STATE_ALIAS" ]: self ._module .params .get (
375
- ds_constants ["TARGET_STATE_ALIAS" ]
376
- ),
377
- }
378
- )
344
+ result = BetterArgParser (arg_defs ).parse_args ({
345
+ ds_constants ["REGION_DATA_SETS_ALIAS" ]: self ._module .params .get (
346
+ ds_constants ["REGION_DATA_SETS_ALIAS" ]
347
+ ),
348
+ ds_constants ["CICS_DATA_SETS_ALIAS" ]: self ._module .params .get (
349
+ ds_constants ["CICS_DATA_SETS_ALIAS" ]
350
+ ),
351
+ ds_constants ["PRIMARY_SPACE_VALUE_ALIAS" ]: self ._module .params .get (
352
+ ds_constants ["PRIMARY_SPACE_VALUE_ALIAS" ]
353
+ ),
354
+ ds_constants ["PRIMARY_SPACE_UNIT_ALIAS" ]: self ._module .params .get (
355
+ ds_constants ["PRIMARY_SPACE_UNIT_ALIAS" ]
356
+ ),
357
+ ds_constants ["DATASET_LOCATION_ALIAS" ]: self ._module .params .get (
358
+ ds_constants ["DATASET_LOCATION_ALIAS" ]
359
+ ),
360
+ ds_constants ["TARGET_STATE_ALIAS" ]: self ._module .params .get (
361
+ ds_constants ["TARGET_STATE_ALIAS" ]
362
+ ),
363
+ })
379
364
380
365
size = self ._get_data_set_size (result )
381
366
self .data_set = self ._get_data_set_object (size , result )
0 commit comments