summaryrefslogtreecommitdiffstats
path: root/roles/lib_utils
diff options
context:
space:
mode:
authorOpenShift Merge Robot <openshift-merge-robot@users.noreply.github.com>2018-01-30 12:22:44 -0800
committerGitHub <noreply@github.com>2018-01-30 12:22:44 -0800
commit4cf65887f803016f55c6a529a740dfd6c02e7325 (patch)
tree5409cf0ee650af123f3fd5c4f86177857af8fc55 /roles/lib_utils
parent2afe2596c6dd9641bdbb3c6294d5df53f5c140f5 (diff)
parentd7741d8bc0f0f320cb061bf63bcd2629b5e583a9 (diff)
downloadopenshift-4cf65887f803016f55c6a529a740dfd6c02e7325.tar.gz
openshift-4cf65887f803016f55c6a529a740dfd6c02e7325.tar.bz2
openshift-4cf65887f803016f55c6a529a740dfd6c02e7325.tar.xz
openshift-4cf65887f803016f55c6a529a740dfd6c02e7325.zip
Merge pull request #6934 from vrutkovs/docker_creds-write-decode
Automatic merge from submit-queue. docker_creds: decode docker_config for py3 only if its a string Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1539552
Diffstat (limited to 'roles/lib_utils')
-rw-r--r--roles/lib_utils/library/docker_creds.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/roles/lib_utils/library/docker_creds.py b/roles/lib_utils/library/docker_creds.py
index b94c0b779..936fb1c38 100644
--- a/roles/lib_utils/library/docker_creds.py
+++ b/roles/lib_utils/library/docker_creds.py
@@ -148,10 +148,12 @@ def update_config(docker_config, registry, username, password):
def write_config(module, docker_config, dest):
'''Write updated credentials into dest/config.json'''
+ if not isinstance(docker_config, dict):
+ docker_config = docker_config.decode()
conf_file_path = os.path.join(dest, 'config.json')
try:
with open(conf_file_path, 'w') as conf_file:
- json.dump(docker_config.decode(), conf_file, indent=8)
+ json.dump(docker_config, conf_file, indent=8)
except IOError as ioerror:
result = {'failed': True,
'changed': False,