Skip to content

Commit

Permalink
no outputs, no hostname ;)
Browse files Browse the repository at this point in the history
  • Loading branch information
agentzh committed Apr 23, 2009
1 parent 13912a9 commit 8aa4a03
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 11 deletions.
8 changes: 0 additions & 8 deletions bin/atnodes
Original file line number Diff line number Diff line change
Expand Up @@ -194,12 +194,8 @@ while (1) {
warn "Can't open $outfile for reading: $!\n";
next;
}
my $has_run = 0;
while (<$in>) {
chomp;
if (!$has_run) {
$has_run = 1;
}
if ($line_mode) {
print "$host: ";
}
Expand All @@ -210,10 +206,6 @@ while (1) {
print STDERR "$host: ";
}
warn "Remote command returns status code $exit.\n";
$has_run = 1;
}
if (!$has_run && $line_mode) {
print "$host: \n";
}
if (!$line_mode) {
print "\n";
Expand Down
2 changes: 1 addition & 1 deletion lib/SSH/Batch.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package SSH::Batch;
use strict;
use warnings;

our $VERSION = '0.009';
our $VERSION = '0.010';

1;
__END__
Expand Down
2 changes: 1 addition & 1 deletion lib/SSH/Batch/ForNodes.pm
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package SSH::Batch::ForNodes;
use strict;
use warnings;

our $VERSION = '0.009';
our $VERSION = '0.010';

use Set::Scalar;
use File::HomeDir;
Expand Down
7 changes: 6 additions & 1 deletion t/agentzh.t
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ ok $count > 3, "more than 3 hosts in {tq} (found $count)";
}
}

{
my $out = atnodes2('echo -n', '{tq}', '-L');
is $out, '', 'no output, no hostname';
}

cleanup_remote_tree($count);
my $outs = tonodes('-r', '-rsync', 't/tmp', '--', '{tq}', ':/tmp/');
for my $out (@$outs) {
Expand Down Expand Up @@ -181,7 +186,6 @@ $outs = tonodes('t/tmp', '{tq}:/tmp/', '-v');
for my $out (@$outs) {
is $out, "\n", 'transfer successfuly';
}
exit;

$outs = atnodes('ls /tmp/tmp', '{tq}');
is scalar(@$outs), $count, 'all hosts generate outputs';
Expand Down Expand Up @@ -235,3 +239,4 @@ for my $out (@$outs) {
is $out, "\nREADME\na.txt\nb.txt\n\n", 'only specified files uploaded';
}

warn "DONE.\n";

0 comments on commit 8aa4a03

Please sign in to comment.