diff --git a/runbot/container.py b/runbot/container.py index e8eff021..797e7c44 100644 --- a/runbot/container.py +++ b/runbot/container.py @@ -121,7 +121,7 @@ def docker_run(*args, **kwargs): return _docker_run(*args, **kwargs) -def _docker_run(run_cmd, log_path, build_dir, container_name, image_tag='odoo:DockerDefault', exposed_ports=None, cpu_limit=None, preexec_fn=None, ro_volumes=None, env_variables=None): +def _docker_run(run_cmd, log_path, build_dir, container_name, image_tag=False, exposed_ports=None, cpu_limit=None, preexec_fn=None, ro_volumes=None, env_variables=None): """Run tests in a docker container :param run_cmd: command string to run in container :param log_path: path to the logfile that will contain odoo stdout and stderr @@ -133,6 +133,7 @@ def _docker_run(run_cmd, log_path, build_dir, container_name, image_tag='odoo:Do :params ro_volumes: dict of dest:source volumes to mount readonly in builddir :params env_variables: list of environment variables """ + image_tag = image_tag or 'odoo:DockerDefault' container_name = sanitize_container_name(container_name) if isinstance(run_cmd, Command): cmd_object = run_cmd diff --git a/runbot/models/host.py b/runbot/models/host.py index f4fc8ca5..f670177f 100644 --- a/runbot/models/host.py +++ b/runbot/models/host.py @@ -82,7 +82,7 @@ class Host(models.Model): with open(os.path.join(docker_build_path, 'Dockerfile'), 'w') as Dockerfile: Dockerfile.write(dockerfile.dockerfile) build_process = docker_build(docker_build_path, dockerfile.image_tag) - if build_process.returncode != 0: + if build_process != 0: dockerfile.to_build = False message = 'Dockerfile build "%s" failed on host %s' % (dockerfile.image_tag, self.name) dockerfile.message_post(body=message)