summaryrefslogtreecommitdiff
path: root/cloudinit/reporting
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2015-09-17 15:56:51 -0400
committerScott Moser <smoser@ubuntu.com>2015-09-17 15:56:51 -0400
commit4558922ac6d8ae129b1f47e124c6b08008e7548f (patch)
tree6281d36d897ef3e04fa2f7d7da1445dc3735c759 /cloudinit/reporting
parent03b5cac37154476b89e67b231c2888a9cfdc92ca (diff)
downloadvyos-cloud-init-4558922ac6d8ae129b1f47e124c6b08008e7548f.tar.gz
vyos-cloud-init-4558922ac6d8ae129b1f47e124c6b08008e7548f.zip
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
Diffstat (limited to 'cloudinit/reporting')
-rw-r--r--cloudinit/reporting/handlers.py3
1 files changed, 2 insertions, 1 deletions
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: