diff options
author | Scott Moser <smoser@ubuntu.com> | 2015-09-17 15:56:51 -0400 |
---|---|---|
committer | Scott Moser <smoser@ubuntu.com> | 2015-09-17 15:56:51 -0400 |
commit | 4558922ac6d8ae129b1f47e124c6b08008e7548f (patch) | |
tree | 6281d36d897ef3e04fa2f7d7da1445dc3735c759 /cloudinit/reporting/handlers.py | |
parent | 03b5cac37154476b89e67b231c2888a9cfdc92ca (diff) | |
download | vyos-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/handlers.py')
-rw-r--r-- | cloudinit/reporting/handlers.py | 3 |
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: |