From fc74f9a4f20ae149b28518bc0992966e0ad7e915 Mon Sep 17 00:00:00 2001 From: Simon Keil Date: Sat, 8 Jul 2023 10:11:45 +0200 Subject: [PATCH] [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 --- 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