diff options
author | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-02-03T20·35+0000 |
---|---|---|
committer | Eelco Dolstra <e.dolstra@tudelft.nl> | 2010-02-03T20·35+0000 |
commit | d0c32dc135f147ad352e28ff8c648e611516edec (patch) | |
tree | c474e310974cb3f9aa9acb0be1625c7d1cd50799 /scripts/ssh.pm | |
parent | f56a039775930d4ba2b4504440b7ab37dfefeb75 (diff) |
* In the build hook, if connecting to a machine fails, try the other
machines of the right type (if available). This makes the build farm more robust to failures.
Diffstat (limited to 'scripts/ssh.pm')
-rw-r--r-- | scripts/ssh.pm | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/scripts/ssh.pm b/scripts/ssh.pm index 0295cef33b0a..cea486675ece 100644 --- a/scripts/ssh.pm +++ b/scripts/ssh.pm @@ -12,15 +12,16 @@ sub openSSHConnection { my ($host) = @_; die if $sshStarted; $sshHost = $host; - return if system("ssh $sshHost @sshOpts -O check 2> /dev/null") == 0; + return 1 if system("ssh $sshHost @sshOpts -O check 2> /dev/null") == 0; my $tmpDir = tempdir("nix-ssh.XXXXXX", CLEANUP => 1, TMPDIR => 1) or die "cannot create a temporary directory"; push @sshOpts, "-S", "$tmpDir/control"; system("ssh $sshHost @sshOpts -M -N -f") == 0 - or die "unable to start SSH: $?"; + or return 0; $sshStarted = 1; + return 1; } # Tell the master SSH client to exit. |