Commit 36ab8c35 authored by BAIRE Anthony's avatar BAIRE Anthony
Browse files

workaround for docker-py 1.9

parent ffc1a794
......@@ -1562,9 +1562,23 @@ class PushManager(Manager):
tag = version.number
log.info("push from the %-8s %s:%s", "sandbox", image, tag)
yield from self.run_in_executor(lambda: docker_check_error(
self.ctrl.sandbox.push, image, tag,
auth_config=self.auth_dict.get_auth_config(image)))
# FIXME: docker-py folks are morons in 1.9.0 they added the
# 'auth_config' argument for .pull() but not for .push()
# thus we have to use .login() instead (but I don't want to
# do a global .login() at startup because this may fail if
# the registry is down)
#
# the following code will work w/ versions >=1.10
#yield from self.run_in_executor(lambda: docker_check_error(
# self.ctrl.sandbox.push, image, tag,
# auth_config=self.auth_dict.get_auth_config(image)))
#
def do_push():
auth_config = self.auth_dict.get_auth_config(image)
self.ctrl.sandbox.login(auth_config["username"], auth_config["password"],
registry=image)
docker_check_error(self.ctrl.sandbox.push, image, tag)
yield from self.run_in_executor(do_push)
reset()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment