Added missing json 'encode' function

At python3 strings are not byte arrays, we have to encode them.

Change-Id: Ia9254fdeab853ab663d93973dc1fae1e5dbc26ab
This commit is contained in:
Quique Llorente 2018-11-08 13:02:14 +01:00
parent 73e2125532
commit 294969926f
1 changed files with 2 additions and 1 deletions

View File

@ -187,7 +187,8 @@ def invoke_hook(c, log):
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
stdout, stderr = subproc.communicate(input=json.dumps(signal_data))
stdout, stderr = subproc.communicate(
input=json.dumps(signal_data).encode('utf-8', 'replace'))
log.info(stdout)