Skip to content
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
cc5ee6c
Test
AndreMarcel99 Jul 10, 2025
2f7a1c4
Modify action job submit
Jul 16, 2025
1972bd6
Replace structure for empty jobs
Jul 16, 2025
47510bc
Modify structure
Jul 16, 2025
e9994da
Modify test to properly test new interface
Jul 16, 2025
75b09f7
Modify test on base of job submit new interface
Jul 16, 2025
f21e73e
Be alignt
Jul 16, 2025
33f8a0f
Modify job submit
Jul 16, 2025
0d46bdc
Add fragment
Jul 16, 2025
84b4292
Better fragment
Jul 16, 2025
ade2f0b
Update documentation
Jul 16, 2025
cebe0b9
Fix commit
Jul 17, 2025
41e9653
Fix documentation
Jul 17, 2025
3b5ee97
Keep documentation
Jul 17, 2025
0ec0660
Replace job submit
Jul 17, 2025
8886ca4
Fix sanity
Jul 17, 2025
49f7997
Fix sanity
Jul 17, 2025
4d8102c
Return values
Aug 1, 2025
14702c1
Return values to module
Aug 1, 2025
0327d58
Return values to test suite and empty response
Aug 1, 2025
b4ca89d
Update changelogs/fragments/2208_update_job_modules_interfaces.yml
AndreMarcel99 Aug 1, 2025
ed9905e
Update changelogs/fragments/2208_update_job_modules_interfaces.yml
AndreMarcel99 Aug 1, 2025
b46b1fd
Update changelogs/fragments/2208_update_job_modules_interfaces.yml
AndreMarcel99 Aug 1, 2025
cf8e264
Fix job submit
Aug 1, 2025
1c1eb89
Validate test case
Aug 1, 2025
b991112
Validate test case
Aug 1, 2025
f69ba71
Validate test case
Aug 1, 2025
80dd2be
Validate test case
Aug 1, 2025
b88ca4f
Validate test case
Aug 1, 2025
ca75e70
Validate test case
Aug 1, 2025
afc2bf5
Validate test case
Aug 1, 2025
a39b28d
Update changelogs/fragments/2204-Update_zos_job_query_module.yml
AndreMarcel99 Aug 1, 2025
8030ad2
Update plugins/modules/zos_job_submit.py
AndreMarcel99 Aug 1, 2025
b70786b
Update plugins/modules/zos_job_submit.py
AndreMarcel99 Aug 1, 2025
c4e9db8
Update plugins/modules/zos_job_submit.py
AndreMarcel99 Aug 1, 2025
d8da79d
Update plugins/modules/zos_job_submit.py
AndreMarcel99 Aug 1, 2025
0b07a67
Update changelogs/fragments/2208_update_job_modules_interfaces.yml
AndreMarcel99 Aug 4, 2025
68cd698
Update changelogs/fragments/2208_update_job_modules_interfaces.yml
AndreMarcel99 Aug 4, 2025
5076094
Update changelogs/fragments/2208_update_job_modules_interfaces.yml
AndreMarcel99 Aug 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion changelogs/fragments/2204-Update_zos_job_query_module.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
breaking_changes:
- zos_job_query - Return value ``message`` is deprecated in favor of ``msg``. Return value ``steps`` are no longer under `` but is now included under jobs.
- zos_job_query - Return value ``message`` is deprecated in favor of ``msg``. Return value ``steps`` are no longer under ``ret_code`` but is now included under jobs.
(https://github.com/ansible-collections/ibm_zos_core/pull/2204).
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this be ...pull/2208 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the other changelog, this is form the previous PR of changes of zos_job_query, but I realize I miss one problem

12 changes: 12 additions & 0 deletions changelogs/fragments/2208_update_job_modules_interfaces.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
breaking_changes:
- zos_job_output - Interface value ``ddname`` is substitute for ``dd_name``, but ``ddname`` is an alias. Return value ``changed`` is always retun, ``steps`` are no longer under `ret_code`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- zos_job_output - Interface value ``ddname`` is substitute for ``dd_name``, but ``ddname`` is an alias. Return value ``changed`` is always retun, ``steps`` are no longer under `ret_code`
- zos_job_output - Option ``ddname`` is substituted for ``dd_name``, but retaining ``ddname`` as an alias. Return field ``changed`` is now always returned, ``steps`` is no longer under `ret_code`

but is now included under `jobs`. Return value ``ddnames`` replaced by ``dds`` and value ``ddname`` under ``ddnames`` is replace by ``dd_name``.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
but is now included under `jobs`. Return value ``ddnames`` replaced by ``dds`` and value ``ddname`` under ``ddnames`` is replace by ``dd_name``.
but is now included under `jobs`. Return field ``ddnames`` is replaced by ``dds`` and field ``ddname`` under ``ddnames`` is replaced by ``dd_name``.

(https://github.com/ansible-collections/ibm_zos_core/pull/2208).
- zos_job_submit - Interface value ``location`` is replace for ``remote_src`` in a bool value and ``wait_time_s`` ir replace for ``wait_time``.
Return value ``ddnames`` replaced by ``dds`` and value ``ddname`` under ``ddnames`` is replace by ``dd_name``. Now all values are retuned under jobs exception for changed.
(https://github.com/ansible-collections/ibm_zos_core/pull/2208).

trivial:
- test/zos_job_query_func.py - Update test validation to new values for job submit. Return value ``steps`` are no longer under `ret_code`
but is now included under `jobs`.
(https://github.com/ansible-collections/ibm_zos_core/pull/2208).
8 changes: 4 additions & 4 deletions plugins/action/zos_job_submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,16 +45,16 @@ def run(self, tmp=None, task_vars=None):
module_args = self._task.args.copy()

use_template = _process_boolean(module_args.get("use_template"))
location = module_args.get("location")
if use_template and location != "local":
remote_src = module_args.get("remote_src")
if use_template and remote_src:
result.update(dict(
failed=True,
changed=False,
msg="Use of Jinja2 templates is only valid for local files. Location is set to '{0}' but should be 'local'".format(location)
msg="Use of Jinja2 templates is only valid for local files. remote_src is set to '{0}' but should be False".format(remote_src)
))
return result

if location == "local":
if not remote_src:

source = self._task.args.get("src", None)

Expand Down
45 changes: 29 additions & 16 deletions plugins/module_utils/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ def _job_not_found(job_id, owner, job_name, dd_name):
job_not_found_msg = "with the name {0}".format(job_name.upper())
job = {}

job["job_not_found"] = True
job["job_id"] = job_id
job["job_name"] = job_name
job["subsystem"] = None
Expand All @@ -175,24 +176,36 @@ def _job_not_found(job_id, owner, job_name, dd_name):
job["cpu_time"] = None
job["execution_node"] = None
job["origin_node"] = None
job["content_type"] = None
job["creation_date"] = None
job["creation_time"] = None
job["execution_time"] = None
job["job_class"] = None
job["svc_class"] = None
job["priority"] = None
job["asid"] = None
job["queue_position"] = None
job["program_name"] = None

job["ret_code"] = {}
job["ret_code"]["msg"] = None
job["ret_code"]["code"] = None
job["ret_code"]["msg_code"] = None
job["ret_code"]["msg_txt"] = "The job {0} could not be found.".format(job_not_found_msg)
job["steps"] = []

job["class"] = ""
job["class"] = None

job["ddnames"] = []
job["dds"] = []
dd = {}
dd["ddname"] = dd_name
dd["record_count"] = "0"
dd["id"] = ""
dd["dd_name"] = dd_name
dd["record_count"] = 0
dd["id"] = None
dd["stepname"] = None
dd["procstep"] = ""
dd["byte_count"] = "0"
job["ddnames"].append(dd)
dd["procstep"] = None
dd["byte_count"] = 0
dd["content"] = None
job["dds"].append(dd)

jobs.append(job)

Expand Down Expand Up @@ -351,8 +364,8 @@ def _get_job_status(job_id="*", owner="*", job_name="*", dd_name=None, dd_scan=T
job = {}
job["job_id"] = entry.job_id
job["job_name"] = entry.name
job["subsystem"] = ""
job["system"] = ""
job["subsystem"] = None
job["system"] = None
job["owner"] = entry.owner
job["cpu_time"] = None
job["execution_node"] = None
Expand Down Expand Up @@ -380,9 +393,9 @@ def _get_job_status(job_id="*", owner="*", job_name="*", dd_name=None, dd_scan=T
job["creation_time"] = str(entry.creation_datetime)[12:]
job["queue_position"] = entry.queue_position
job["program_name"] = entry.program_name
job["class"] = ""
job["class"] = None
job["steps"] = []
job["ddnames"] = []
job["dds"] = []
job["duration"] = duration
if hasattr(entry, "execution_time"):
job["execution_time"] = entry.execution_time
Expand Down Expand Up @@ -444,7 +457,7 @@ def _get_job_status(job_id="*", owner="*", job_name="*", dd_name=None, dd_scan=T
if dd_name not in single_dd["dd_name"]:
continue
else:
dd["ddname"] = single_dd["dd_name"]
dd["dd_name"] = single_dd["dd_name"]

if "records" in single_dd:
dd["record_count"] = single_dd["records"]
Expand Down Expand Up @@ -495,8 +508,8 @@ def _get_job_status(job_id="*", owner="*", job_name="*", dd_name=None, dd_scan=T

job["steps"].extend(_parse_steps(tmpcont))

job["ddnames"].append(dd)
if len(job["class"]) < 1:
job["dds"].append(dd)
if job["class"] is None:
job["class"] = entry.job_class

if job["system"] is None:
Expand Down Expand Up @@ -545,7 +558,7 @@ def _ddname_pattern(contents, resolve_dependencies):
re.IGNORECASE,
):
raise ValueError(
'Invalid argument type for "{0}". Expected "ddname_pattern"'.format(
'Invalid argument type for "{0}". Expected "dd_name_pattern"'.format(
contents
)
)
Expand Down
Loading