From 1879f2c2352c5146f651ec058513a2eff28746b8 Mon Sep 17 00:00:00 2001 From: Xavier-Do Date: Fri, 10 Jun 2022 13:26:27 +0200 Subject: [PATCH] [IMP] runbot: forced host improvement --- runbot/models/batch.py | 5 ++++- runbot/templates/frontend.xml | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/runbot/models/batch.py b/runbot/models/batch.py index e881e67b..2db6a142 100644 --- a/runbot/models/batch.py +++ b/runbot/models/batch.py @@ -117,7 +117,10 @@ class Batch(models.Model): Create a build with given params_id if it does not already exists. In the case that a very same build already exists that build is returned """ - build = self.env['runbot.build'].search([('params_id', '=', params.id), ('parent_id', '=', False)], limit=1, order='id desc') + domain = [('params_id', '=', params.id), ('parent_id', '=', False)] + if self.bundle_id.host_id: + domain += [('host', '=', self.bundle_id.host_id.name), ('keep_host', '=', True)] + build = self.env['runbot.build'].search(domain, limit=1, order='id desc') link_type = 'matched' if build: if build.killable: diff --git a/runbot/templates/frontend.xml b/runbot/templates/frontend.xml index 9e5b7556..c6132f1b 100644 --- a/runbot/templates/frontend.xml +++ b/runbot/templates/frontend.xml @@ -57,6 +57,9 @@ +
+ +