From ed4bc4c1d2f24d22f112dc769116b7ac8bd2da0c Mon Sep 17 00:00:00 2001 From: "patchback[bot]" <45432694+patchback[bot]@users.noreply.github.com> Date: Sat, 8 Jul 2023 18:10:16 +0200 Subject: [PATCH] [PR #6811/fc74f9a4 backport][stable-7] [datadog_downtime] - added 'type' to recurrence object when rrule param is present (#6891) [datadog_downtime] - added 'type' to recurrence object when rrule param is present (#6811) * added 'type' to recurrence object when rrule param is present * formatting cleanup (cherry picked from commit fc74f9a4f20ae149b28518bc0992966e0ad7e915) Co-authored-by: Simon Keil --- changelogs/fragments/6811-datadog-downtime-rrule-type.yaml | 2 ++ plugins/modules/datadog_downtime.py | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/6811-datadog-downtime-rrule-type.yaml diff --git a/changelogs/fragments/6811-datadog-downtime-rrule-type.yaml b/changelogs/fragments/6811-datadog-downtime-rrule-type.yaml new file mode 100644 index 0000000000..0106f8fb7e --- /dev/null +++ b/changelogs/fragments/6811-datadog-downtime-rrule-type.yaml @@ -0,0 +1,2 @@ +bugfixes: + - datadog_downtime - presence of ``rrule`` param lead to the Datadog API returning Bad Request due to a missing recurrence type (https://github.com/ansible-collections/community.general/pull/6811). diff --git a/plugins/modules/datadog_downtime.py b/plugins/modules/datadog_downtime.py index b3e71469b6..a3a6a660f0 100644 --- a/plugins/modules/datadog_downtime.py +++ b/plugins/modules/datadog_downtime.py @@ -248,7 +248,8 @@ def build_downtime(module): downtime.timezone = module.params["timezone"] if module.params["rrule"]: downtime.recurrence = DowntimeRecurrence( - rrule=module.params["rrule"] + rrule=module.params["rrule"], + type="rrule", ) return downtime