Browse Source

Added missing json 'encode' function

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

Change-Id: Ia9254fdeab853ab663d93973dc1fae1e5dbc26ab
tags/1.8.0
Quique Llorente 7 months ago
parent
commit
294969926f
1 changed files with 2 additions and 1 deletions
  1. 2
    1
      heat-config/os-refresh-config/configure.d/55-heat-config

+ 2
- 1
heat-config/os-refresh-config/configure.d/55-heat-config View File

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

Loading…
Cancel
Save