1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Fix nrdp string arguments without an encoding (#3909)

* Fix nrdp string arguments without an encoding

* added changelog fragment

Signed-off-by: Jesse Harris <zigford@gmail.com>

* Update changelogs/fragments/3909-nrdp_fix_string_args_without_encoding.yaml

Co-authored-by: Felix Fontein <felix@fontein.de>

Co-authored-by: Felix Fontein <felix@fontein.de>
This commit is contained in:
Jesse Harris 2021-12-18 02:06:20 +10:00 committed by GitHub
parent 00a1152bb1
commit 40ffd559ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View file

@ -0,0 +1,2 @@
bugfixes:
- nrdp callback plugin - fix error ``string arguments without an encoding`` (https://github.com/ansible-collections/community.general/issues/3903).

View file

@ -70,6 +70,7 @@ import os
import json import json
from ansible.module_utils.six.moves.urllib.parse import urlencode from ansible.module_utils.six.moves.urllib.parse import urlencode
from ansible.module_utils.common.text.converters import to_bytes
from ansible.module_utils.urls import open_url from ansible.module_utils.urls import open_url
from ansible.plugins.callback import CallbackBase from ansible.plugins.callback import CallbackBase
@ -143,7 +144,7 @@ class CallbackModule(CallbackBase):
body = { body = {
'cmd': 'submitcheck', 'cmd': 'submitcheck',
'token': self.token, 'token': self.token,
'XMLDATA': bytes(xmldata) 'XMLDATA': to_bytes(xmldata)
} }
try: try: