diff --git a/plugins/action/get_tasks.py b/plugins/action/get_tasks.py index 36cf4d7..b12f3a2 100644 --- a/plugins/action/get_tasks.py +++ b/plugins/action/get_tasks.py @@ -4,7 +4,7 @@ # SPDX-License-Identifier: GPL-3.0-or-later # Retrieves list of tasks from Itential Platform. Supports filtering via parameters. -# Returns: List of task objects with their status and details. +# Returns: List of task objects with their status, details, and type. # Example: # - name: Get tasks by status # itential.platform.get_tasks: @@ -33,6 +33,6 @@ def run(self, tmp=None, task_vars=None): method = "GET" - params["include"] = "name,status" + params["include"] = "name,status,type" return make_request(task_vars, method, endpoint, params=params) diff --git a/plugins/action/restart_adapters.py b/plugins/action/restart_adapters.py index e71e1c6..ad3a85b 100644 --- a/plugins/action/restart_adapters.py +++ b/plugins/action/restart_adapters.py @@ -53,4 +53,4 @@ def run(self, tmp=None, task_vars=None): response = make_request(task_vars, method, endpoint) results.append(response) - return {"results": results} # Always return a list + return {"results": results} diff --git a/tests/unit/test_input_action_module.py b/tests/unit/test_input_action_module.py index 28aaf50..f5b8080 100644 --- a/tests/unit/test_input_action_module.py +++ b/tests/unit/test_input_action_module.py @@ -9,13 +9,11 @@ @pytest.mark.parametrize("action_module_class, input_args, expected_endpoint, expected_method, expected_params", [ (GetJobs, {"status": "running", "name": "greg"}, "/operations-manager/jobs", "GET", { "equals[status]": "running", - "equals[name]": "greg", - "include": "name,status" + "equals[name]": "greg" }), (GetTasks, {"status": "running", "name": "greg"}, "/operations-manager/tasks", "GET", { "equals[status]": "running", - "equals[name]": "greg", - "include": "name,status" + "equals[name]": "greg" }), ]) @patch("ansible_collections.itential.core.plugins.module_utils.http.send_request")