Kaynağa Gözat

docker_creds: fix python3 exception

Solves this exception with python3:

TypeError: a bytes-like object is required, not 'str

Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
Giuseppe Scrivano 7 yıl önce
ebeveyn
işleme
fa2ea50c05
1 değiştirilmiş dosya ile 1 ekleme ve 1 silme
  1. 1 1
      roles/lib_utils/library/docker_creds.py

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

@@ -135,7 +135,7 @@ def update_config(docker_config, registry, username, password):
         docker_config['auths'][registry] = {}
 
     # base64 encode our username:password string
-    encoded_data = base64.b64encode('{}:{}'.format(username, password))
+    encoded_data = base64.b64encode('{}:{}'.format(username, password).encode())
 
     # check if the same value is already present for idempotency.
     if 'auth' in docker_config['auths'][registry]: