mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-04-26 12:21:26 -07:00
use ansible json encoder for results in callbacks (#46830)
* use ansible json encoder for results in callbacks
This commit is contained in:
parent
ade5d938c3
commit
643ff29d2d
6 changed files with 18 additions and 13 deletions
|
@ -61,8 +61,9 @@ import getpass
|
|||
from datetime import datetime
|
||||
from os.path import basename
|
||||
|
||||
from ansible.plugins.callback import CallbackBase
|
||||
from ansible.module_utils.urls import open_url
|
||||
from ansible.parsing.ajson import AnsibleJSONEncoder
|
||||
from ansible.plugins.callback import CallbackBase
|
||||
|
||||
|
||||
class SumologicHTTPCollectorSource(object):
|
||||
|
@ -108,7 +109,7 @@ class SumologicHTTPCollectorSource(object):
|
|||
|
||||
open_url(
|
||||
url,
|
||||
data=json.dumps(data, sort_keys=True),
|
||||
data=json.dumps(data, cls=AnsibleJSONEncoder, sort_keys=True),
|
||||
headers={
|
||||
'Content-type': 'application/json',
|
||||
'X-Sumo-Host': data['ansible_host']
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue