Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: remove event_stream_type for event_stream module #339

Merged
merged 2 commits into from
Oct 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
16 changes: 11 additions & 5 deletions plugins/modules/event_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@
event_stream_type:
description:
- Type of the event stream.
- This field is not necessary to create an event stream and will be ignored.
- This field will be removed in version 3.0.0.
type: str
aliases:
- type
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="3.0.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

- name: Check event stream is not created again
Expand All @@ -95,7 +92,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 @@ -109,7 +105,6 @@
name: "{{ new_event_stream_name }}"
credential_name: "{{ credential_name }}"
organization_name: Default
event_stream_type: "basic"
register: _result

- name: Check event stream is not updated again
Expand All @@ -133,7 +128,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