Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
Signed-off-by: Alina Buzachis <[email protected]>
  • Loading branch information
alinabuzachis committed Aug 16, 2024
1 parent be85a28 commit fd0783a
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
10 changes: 10 additions & 0 deletions plugins/modules/activation.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,9 @@
type: str
extends_documentation_fragment:
- ansible.eda.eda_controller.auths
notes:
- Rulebook Activation API does not support PATCH method, due to this reason the module will
not perform any modification when an existing rulebook activation is found.
"""

EXAMPLES = """
Expand Down Expand Up @@ -332,6 +335,13 @@ def main():
except EDAError as e:
module.fail_json(msg=f"Failed to delete rulebook activation: {e}")

Check warning on line 336 in plugins/modules/activation.py

View check run for this annotation

Codecov / codecov/patch

plugins/modules/activation.py#L332-L336

Added lines #L332 - L336 were not covered by tests

if activation:
module.exit_json(

Check warning on line 339 in plugins/modules/activation.py

View check run for this annotation

Codecov / codecov/patch

plugins/modules/activation.py#L339

Added line #L339 was not covered by tests
msg=f"A rulebook activation with name: {name} already exists. "
"The module does not support modifying a rulebook activation.",
**{"changed": False, "id": activation["id"]},
)

# Activation Data that will be sent for create/update
activation_params = create_params(module, controller)
activation_params["name"] = (

Check warning on line 347 in plugins/modules/activation.py

View check run for this annotation

Codecov / codecov/patch

plugins/modules/activation.py#L346-L347

Added lines #L346 - L347 were not covered by tests
Expand Down
3 changes: 1 addition & 2 deletions tests/integration/targets/activation/tasks/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
---
# This YAML file contains Ansible tasks for managing projects.
# The tasks include generating a test ID, creating a project, updating the project, and deleting the project.
- block:
- set_fact:
credential_defaults: &credential_defaults
Expand Down Expand Up @@ -183,6 +181,7 @@
assert:
that:
- not _result.changed
- "'A rulebook activation with name: {{ activation_name }} already exists. The module does not support modifying a rulebook activation.' in _result.msg"

- name: Get information about the rulebook activation
ansible.eda.activation_info:
Expand Down

0 comments on commit fd0783a

Please sign in to comment.