From 20f8bdb9cf39bcb3466a18f58b513bf2694d512a Mon Sep 17 00:00:00 2001 From: Ian Jackson Date: Tue, 29 Sep 2015 14:47:33 +0100 Subject: [PATCH] ts-hosts-allocate-Executive: Do not allocate specific host with wrong blessing If the job contains a runvar specifying a specific host, still check that host's blessing. Otherwise bisections can run on unblessed hosts. They should fail instead. Signed-off-by: Ian Jackson Acked-by: Ian Campbell --- ts-hosts-allocate-Executive | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/ts-hosts-allocate-Executive b/ts-hosts-allocate-Executive index dd9fcf28..88da5043 100755 --- a/ts-hosts-allocate-Executive +++ b/ts-hosts-allocate-Executive @@ -279,26 +279,26 @@ sub hid_find_possibilities ($) { my $use= $hid->{OverrideUse} || $r{ $hid->{Ident} }; - my $findhostsq; - if (defined $use) { - print DEBUG "HID $hid->{Ident} USE $use\n"; - $findhostsq= $dbh_tests->prepare(<execute('host',$use); - } else { - print DEBUG "HID $hid->{Ident} INTENDED $fi->{intended}\n"; - $findhostsq= $dbh_tests->prepare(<{Ident} INTENDED $fi->{intended}\n"; + my $findhostsq = <execute("blessed-$fi->{intended}"); + my @findhostsqvars = ("blessed-$fi->{intended}"); + + if (defined $use) { + print DEBUG "HID $hid->{Ident} USE $use\n"; + $findhostsq .= <prepare($findhostsq); + $findhostsq->execute(@findhostsqvars); + my $equivstatusq= $dbh_tests->prepare(<{Ident} nonexistent?"); + logm("specified host $use for $hid->{Ident} nonexistent or unblessed?"); } else { logm("no suitable host for $hid->{Ident} (out of $any)"); } -- 2.39.5