From dcf3297bffde57a8e33e4f2aec4980a82e2c591d Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Fri, 19 Jul 2019 13:56:19 +0200 Subject: [PATCH] [FIX] runbot: forbid wake-up on dead builds When a build is completely dead, with directory and db deleted, the wake-up system fails. With this commit, a wake-up is not allowed on such dead builds. --- runbot/models/build.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/runbot/models/build.py b/runbot/models/build.py index dd40c781..fa7e0bff 100644 --- a/runbot/models/build.py +++ b/runbot/models/build.py @@ -543,6 +543,9 @@ class runbot_build(models.Model): if docker_is_running(build._get_docker_name()): build.write({'requested_action': False, 'local_state': 'running'}) build._log('wake_up', 'Waking up failed, docker is already running', level='SEPARATOR') + elif not os.path.exists(build._path()): + build.write({'requested_action': False, 'local_state': 'done'}) + build._log('wake_up', 'Impossible to wake-up, build dir does not exists anymore', level='SEPARATOR') else: log_path = build._path('logs', 'wake_up.txt') build.write({'job_start': now(), 'job_end': False, 'active_step': False, 'requested_action': False, 'local_state': 'running'})