Skip to content

Commit

Permalink
fix: remove event_stream_type for event_stream module
Browse files Browse the repository at this point in the history
Signed-off-by: Alex <[email protected]>
  • Loading branch information
Alex-Izquierdo committed Oct 9, 2024
1 parent 94d1e12 commit 982ca0d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 12 deletions.
16 changes: 11 additions & 5 deletions plugins/modules/event_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,11 @@
event_stream_type:
description:
- Type of the event stream.
- This field is not necessary to create an event stream and will be ignored.
type: str
aliases:
- type
removed_in_version: 2.3.0
headers:
description:
- Comma separated HTTP header keys that you want to include in the event payload.
Expand Down Expand Up @@ -114,9 +116,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
Expand Down Expand Up @@ -157,10 +156,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.3.0",
removed_from_collection="ansible.eda",
),
)

argument_spec.update(AUTH_ARGSPEC)
Expand All @@ -169,7 +174,7 @@ def main() -> None:
(
"state",
"present",
("name", "credential_name", "organization_name", "event_stream_type"),
("name", "credential_name", "organization_name"),
)
]

Expand Down Expand Up @@ -206,6 +211,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:
Expand Down
1 change: 0 additions & 1 deletion tests/integration/targets/activation/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 0 additions & 6 deletions tests/integration/targets/event_stream/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@
credential_name: "{{ credential_name }}"
organization_name: Default
forward_events: false
event_stream_type: "basic"
check_mode: true
register: _result

Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 982ca0d

Please sign in to comment.