forked from lix-project/hydra
Handle SSH hosts without a @
This commit is contained in:
parent
745efce828
commit
c6d504edbb
|
@ -9,7 +9,7 @@ __PACKAGE__->config(
|
|||
ENCODING => 'utf-8',
|
||||
PRE_CHOMP => 1,
|
||||
POST_CHOMP => 1,
|
||||
expose_methods => [qw/buildLogExists buildStepLogExists jobExists/]);
|
||||
expose_methods => [qw/buildLogExists buildStepLogExists jobExists stripSSHUser/]);
|
||||
|
||||
sub buildLogExists {
|
||||
my ($self, $c, $build) = @_;
|
||||
|
@ -23,6 +23,16 @@ sub buildStepLogExists {
|
|||
return defined findLog($c, $step->drvpath, @outPaths);
|
||||
}
|
||||
|
||||
|
||||
sub stripSSHUser {
|
||||
my ($self, $c, $name) = @_;
|
||||
if ($name =~ /^.*@(.*)$/) {
|
||||
return $1;
|
||||
} else {
|
||||
return $name;
|
||||
}
|
||||
}
|
||||
|
||||
# Check whether the given job is a member of the most recent jobset
|
||||
# evaluation.
|
||||
sub jobExists {
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
</tr>
|
||||
</thead>
|
||||
[% FOREACH m IN machines %]
|
||||
[% name = m.key ? m.key.match('@(.*)').0 : "localhost" %]
|
||||
[% name = m.key ? stripSSHUser(m.key) : "localhost" %]
|
||||
<thead>
|
||||
<tr>
|
||||
<th colspan="6">
|
||||
|
@ -27,7 +27,7 @@
|
|||
<tbody>
|
||||
[% idle = 1 %]
|
||||
[% FOREACH step IN steps %]
|
||||
[% name2 = step.machine ? step.machine.match('@(.*)').0 : "localhost" %]
|
||||
[% name2 = step.machine ? stripSSHUser(step.machine) : "localhost" %]
|
||||
[% IF name == name2 %]
|
||||
[% idle = 0 %]
|
||||
<tr>
|
||||
|
|
Loading…
Reference in a new issue