From ca4768230d7693c4d9301e53ad8d08a002dc996c Mon Sep 17 00:00:00 2001 From: Christophe Monniez Date: Fri, 17 Jan 2020 17:14:12 +0100 Subject: [PATCH] [FIX] runbot: avoid crash when creating migration symlink --- runbot/models/repo.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runbot/models/repo.py b/runbot/models/repo.py index 36af0b3f..a11b3c77 100644 --- a/runbot/models/repo.py +++ b/runbot/models/repo.py @@ -216,7 +216,10 @@ class runbot_repo(models.Model): migration_repo_id = int(icp.get_param('runbot_migration_repo_id', default=0)) if ln_param and migration_repo_id and self.server_files: scripts_dir = self.env['runbot.repo'].browse(migration_repo_id)._get_repo_name_part() - os.symlink('/data/build/%s' % scripts_dir, self._source_path(sha, ln_param)) + try: + os.symlink('/data/build/%s' % scripts_dir, self._source_path(sha, ln_param)) + except FileNotFoundError: + _logger.warning('Impossible to create migration symlink') # TODO get result and fallback on cleaing in case of problem return export_path