summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJordan Borean <jborean93@gmail.com>2021-02-08 09:56:59 +1000
committerGitHub <noreply@github.com>2021-02-07 17:56:59 -0600
commitbca57ec65a37afe1b91ca27c14474eb9562f56cf (patch)
tree25816dbfac98e46d735bd73388dc8dfe762b5bae
parente75570ba8313e865146b58b97d6e9eb1a67bf6e4 (diff)
downloadansible-bca57ec65a37afe1b91ca27c14474eb9562f56cf.tar.gz
bugfix: use to_text(stdout) in psrp.Connection.put_file method (#73491) - 2.10 (#73496)
(cherry picked from commit f271d02a9fa07299ea4fccbd7554a1bcec1782dc) Co-authored-by: jakegatsby <39974194+jakegatsby@users.noreply.github.com>
-rw-r--r--changelogs/fragments/psrp-json-loads-bytes.yml2
-rw-r--r--lib/ansible/plugins/connection/psrp.py2
2 files changed, 3 insertions, 1 deletions
diff --git a/changelogs/fragments/psrp-json-loads-bytes.yml b/changelogs/fragments/psrp-json-loads-bytes.yml
new file mode 100644
index 0000000000..6cc4c18bc4
--- /dev/null
+++ b/changelogs/fragments/psrp-json-loads-bytes.yml
@@ -0,0 +1,2 @@
+bugfixes:
+ - psrp connection plugin - ``to_text(stdout)`` before ``json.loads`` in psrp.Connection.put_file in case ``stdout`` is bytes.
diff --git a/lib/ansible/plugins/connection/psrp.py b/lib/ansible/plugins/connection/psrp.py
index 38a6259bcd..f03eb8782c 100644
--- a/lib/ansible/plugins/connection/psrp.py
+++ b/lib/ansible/plugins/connection/psrp.py
@@ -470,7 +470,7 @@ class Connection(ConnectionBase):
if rc != 0:
raise AnsibleError(to_native(stderr))
- put_output = json.loads(stdout)
+ put_output = json.loads(to_text(stdout))
remote_sha1 = put_output.get("sha1")
if not remote_sha1: