From bcdc66d3a920e270e389a4408f28e66da3d1f779 Mon Sep 17 00:00:00 2001 From: Alex Date: Wed, 9 Oct 2024 21:10:30 +0200 Subject: [PATCH] fix: remove event_stream_type for event_stream module Signed-off-by: Alex --- plugins/modules/event_stream.py | 20 +++++++++---------- .../targets/activation/tasks/main.yml | 1 - .../targets/event_stream/tasks/main.yml | 6 ------ 3 files changed, 9 insertions(+), 18 deletions(-) diff --git a/plugins/modules/event_stream.py b/plugins/modules/event_stream.py index bfe954a8..3c47fa15 100644 --- a/plugins/modules/event_stream.py +++ b/plugins/modules/event_stream.py @@ -45,12 +45,6 @@ type: str aliases: - organization - event_stream_type: - description: - - Type of the event stream. - type: str - aliases: - - type headers: description: - Comma separated HTTP header keys that you want to include in the event payload. @@ -114,9 +108,6 @@ def create_params(module: AnsibleModule, controller: Controller) -> dict[str, Any]: credential_params: dict[str, Any] = {} - if module.params.get("event_stream_type"): - credential_params["event_stream_type"] = module.params["event_stream_type"] - if module.params.get("forward_events") is not None: if module.params["forward_events"]: credential_params["test_mode"] = False @@ -157,10 +148,16 @@ def main() -> None: new_name=dict(type="str"), credential_name=dict(type="str", aliases=["credential"]), organization_name=dict(type="str", aliases=["organization"]), - event_stream_type=dict(type="str", aliases=["type"]), headers=dict(type="str", default=""), forward_events=dict(type="bool", default=False), state=dict(choices=["present", "absent"], default="present"), + # fix: event_stream_type is not used in the module + event_stream_type=dict( + type="str", + aliases=["type"], + removed_in_version="2.2.0", + removed_from_collection="ansible.eda", + ), ) argument_spec.update(AUTH_ARGSPEC) @@ -169,7 +166,7 @@ def main() -> None: ( "state", "present", - ("name", "credential_name", "organization_name", "event_stream_type"), + ("name", "credential_name", "organization_name"), ) ] @@ -206,6 +203,7 @@ def main() -> None: new_name = module.params.get("new_name") # Attempt to look up event stream based on the provided name + event_stream = {} try: event_stream = controller.get_exactly_one(event_stream_endpoint, name=name) except EDAError as e: diff --git a/tests/integration/targets/activation/tasks/main.yml b/tests/integration/targets/activation/tasks/main.yml index aa16cb4a..a65cf01d 100644 --- a/tests/integration/targets/activation/tasks/main.yml +++ b/tests/integration/targets/activation/tasks/main.yml @@ -225,7 +225,6 @@ name: "{{ event_stream_name }}" credential_name: "{{ credential_name_basic }}" organization_name: Default - event_stream_type: "basic" register: _result - name: Get information about a rulebook diff --git a/tests/integration/targets/event_stream/tasks/main.yml b/tests/integration/targets/event_stream/tasks/main.yml index 1d0f80b2..f023f243 100644 --- a/tests/integration/targets/event_stream/tasks/main.yml +++ b/tests/integration/targets/event_stream/tasks/main.yml @@ -47,7 +47,6 @@ credential_name: "{{ credential_name }}" organization_name: Default forward_events: false - event_stream_type: "basic" check_mode: true register: _result @@ -62,7 +61,6 @@ name: "{{ event_stream_name }}" credential_name: "{{ credential_name }}" organization_name: Default - event_stream_type: "basic" register: _result - name: Check event stream is created @@ -76,7 +74,6 @@ name: "{{ event_stream_name }}" credential_name: "{{ credential_name }}" organization_name: Default - event_stream_type: "basic" register: _result # [WARNING]: The field eda_credential_id of unknown 2 has encrypted data and may @@ -98,7 +95,6 @@ name: "{{ new_event_stream_name }}" credential_name: "{{ credential_name }}" organization_name: Default - event_stream_type: "basic" register: _result - name: Check event stream update @@ -112,7 +108,6 @@ name: "{{ new_event_stream_name }}" credential_name: "{{ credential_name }}" organization_name: Default - event_stream_type: "basic" register: _result # [WARNING]: The field eda_credential_id of unknown 5 has encrypted data and may @@ -139,7 +134,6 @@ name: "{{ new_event_stream_name }}" credential_name: "{{ credential_name }}" organization_name: Default - event_stream_type: "basic" headers: "Authorization,Custom-Header" forward_events: true register: _result