don't send tags to the Grafana annotations API if none are specified

see: https://github.com/ansible/awx/issues/6580
This commit is contained in:
Ryan Petrello
2020-04-06 14:11:52 -04:00
parent 592043fa70
commit 771ca2400a
2 changed files with 7 additions and 6 deletions

View File

@@ -89,7 +89,8 @@ class GrafanaBackend(AWXBaseEmailBackend, CustomNotificationBase):
grafana_data['isRegion'] = self.isRegion
grafana_data['dashboardId'] = self.dashboardId
grafana_data['panelId'] = self.panelId
grafana_data['tags'] = self.annotation_tags
if self.annotation_tags:
grafana_data['tags'] = self.annotation_tags
grafana_data['text'] = m.subject
grafana_headers['Authorization'] = "Bearer {}".format(self.grafana_key)
grafana_headers['Content-Type'] = "application/json"