Skip to content
Snippets Groups Projects
Commit 3da60ed2 authored by jurgenhaas's avatar jurgenhaas
Browse files

ansible/playbooks/general#104 Make sure rawData dump doesn't skip the alert

parent d85892f2
Branches
No related tags found
No related merge requests found
......@@ -63,7 +63,13 @@ class CallbackModule(CallbackBase):
if self.pid != '':
values['attributes'] = {"gitlab_project_id": "%s" % self.pid}
if result is not None:
values['rawData'] = json.dumps(result._result)
try:
values['rawData'] = json.dumps(result._result)
except TypeError:
try:
values['rawData'] = json.dumps(result._result, skipkeys=True)
except TypeError:
values['rawData'] = 'Can not dump result data'
headers = {
'Authorization': 'Key %s' % os.getenv('ALERTA_APIKEY', ''),
'Content-type': 'application/json'
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment