Explorar o código

docker_creds: fix python3 exception

Fixes:

Object of type 'bytes' is not JSON serializable

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Giuseppe Scrivano %!s(int64=7) %!d(string=hai) anos
pai
achega
9585e84e84
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      roles/lib_utils/library/docker_creds.py

+ 1 - 1
roles/lib_utils/library/docker_creds.py

@@ -151,7 +151,7 @@ def write_config(module, docker_config, dest):
     conf_file_path = os.path.join(dest, 'config.json')
     try:
         with open(conf_file_path, 'w') as conf_file:
-            json.dump(docker_config, conf_file, indent=8)
+            json.dump(docker_config.decode(), conf_file, indent=8)
     except IOError as ioerror:
         result = {'failed': True,
                   'changed': False,