From e8920a835748095f8c8ef3b0e29e5769d2ca0078 Mon Sep 17 00:00:00 2001 From: Abigail Howe Date: Mon, 5 Nov 2018 12:59:01 +0000 Subject: [PATCH] fix boolean logic for overwrite parameter (#47916) * fix boolean logic for overwrite parameter * added changelog fragment --- ...7916-grafana_dashboard-fix-logic-behind-overwrite-param.yaml | 2 ++ lib/ansible/modules/monitoring/grafana_dashboard.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/47916-grafana_dashboard-fix-logic-behind-overwrite-param.yaml diff --git a/changelogs/fragments/47916-grafana_dashboard-fix-logic-behind-overwrite-param.yaml b/changelogs/fragments/47916-grafana_dashboard-fix-logic-behind-overwrite-param.yaml new file mode 100644 index 00000000000..b1085b399af --- /dev/null +++ b/changelogs/fragments/47916-grafana_dashboard-fix-logic-behind-overwrite-param.yaml @@ -0,0 +1,2 @@ +bugfixes: + - "reverted change in af55b8e which caused the overwrite parameter to be ignored" diff --git a/lib/ansible/modules/monitoring/grafana_dashboard.py b/lib/ansible/modules/monitoring/grafana_dashboard.py index 91d640e8999..cb1aa51af84 100644 --- a/lib/ansible/modules/monitoring/grafana_dashboard.py +++ b/lib/ansible/modules/monitoring/grafana_dashboard.py @@ -256,7 +256,7 @@ def grafana_create_dashboard(module, data): result['changed'] = False else: # update - if 'overwrite' in data and data['overwrite'] == 'yes': + if 'overwrite' in data and data['overwrite']: payload['overwrite'] = True if 'message' in data and data['message']: payload['message'] = data['message']