@@ -172,8 +172,8 @@ class BuildResult(models.Model):
172172
173173 requested_action = fields .Selection ([('wake_up' , 'To wake up' ), ('deathrow' , 'To kill' )], string = 'Action requested' , index = True )
174174 # web infos
175- host = fields .Char ('Host name' )
176- host_id = fields .Many2one ('runbot.host' , string = "Host" , compute = '_compute_host_id' )
175+ host = fields .Char ('Host name' , index = True )
176+ host_id = fields .Many2one ('runbot.host' , string = "Host" , compute = '_compute_host_id' , search = "_search_host_id" )
177177 keep_host = fields .Boolean ('Keep host on rebuild and for children' )
178178
179179 port = fields .Integer ('Port' )
@@ -252,6 +252,12 @@ def _compute_host_id(self):
252252 for record in self :
253253 record .host_id = get_host (record .host )
254254
255+ def _search_host_id (self , operator , value ):
256+ names = self .env ['runbot.host' ].browse (value ).mapped ('name' )
257+ if isinstance (value , int ):
258+ names = names [0 ]
259+ return [('host' , operator , names )]
260+
255261 @api .depends ('children_ids.global_state' , 'local_state' )
256262 def _compute_global_state (self ):
257263 for record in self :
@@ -969,8 +975,6 @@ def _local_pg_dropdb(self, dbname):
969975 except Exception as e :
970976 msg = f"Failed to drop local logs database : { dbname } with exception: { e } "
971977 _logger .exception (msg )
972- host_name = self .env ['runbot.host' ]._get_current_name ()
973- self .env ['runbot.runbot' ]._warning (f'Host { host_name } : { msg } ' )
974978
975979 def _local_pg_createdb (self , dbname ):
976980 icp = self .env ['ir.config_parameter' ]
0 commit comments