From 4558922ac6d8ae129b1f47e124c6b08008e7548f Mon Sep 17 00:00:00 2001 From: Scott Moser Date: Thu, 17 Sep 2015 15:56:51 -0400 Subject: webhook: report with json data the handler was passing a dictionary to readurl which was then passing that on to requests.request as 'data'. the requests library would urlencode that, but we want the json data posted instead. LP: #1496960 --- cloudinit/reporting/handlers.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'cloudinit/reporting') diff --git a/cloudinit/reporting/handlers.py b/cloudinit/reporting/handlers.py index ba480da0..3212d173 100644 --- a/cloudinit/reporting/handlers.py +++ b/cloudinit/reporting/handlers.py @@ -1,6 +1,7 @@ # vi: ts=4 expandtab import abc +import json import six from ..registry import DictRegistry @@ -77,7 +78,7 @@ class WebHookHandler(ReportingHandler): readurl = url_helper.readurl try: return readurl( - self.endpoint, data=event.as_dict(), + self.endpoint, data=json.dumps(event.as_dict()), timeout=self.timeout, retries=self.retries, ssl_details=self.ssl_details) except: -- cgit v1.2.3