Skip to content

Commit

Permalink
Merge branch 'main' into 30876_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
alinabuzachis authored Oct 11, 2024
2 parents 71783db + 591e212 commit 547004e
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,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

0 comments on commit 547004e

Please sign in to comment.