projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
cd3ed01
)
fix stdin options on shellcommands export, from #831
author
mark
<mark>
Mon, 3 Oct 2011 22:36:52 +0000
(22:36 +0000)
committer
mark
<mark>
Mon, 3 Oct 2011 22:36:52 +0000
(22:36 +0000)
FS/FS/part_export/shellcommands.pm
patch
|
blob
|
history
diff --git
a/FS/FS/part_export/shellcommands.pm
b/FS/FS/part_export/shellcommands.pm
index
4bf273e
..
4d603cb
100644
(file)
--- a/
FS/FS/part_export/shellcommands.pm
+++ b/
FS/FS/part_export/shellcommands.pm
@@
-473,13
+473,17
@@
sub shellcommands_queue {
}
sub ssh_cmd { #subroutine, not method
}
sub ssh_cmd { #subroutine, not method
- # XXX shouldn't this use $opt->{'stdin_string'} at some point?
use Net::OpenSSH;
my $opt = { @_ };
my $ssh = Net::OpenSSH->new($opt->{'user'}.'@'.$opt->{'host'});
die "Couldn't establish SSH connection: ". $ssh->error if $ssh->error;
use Net::OpenSSH;
my $opt = { @_ };
my $ssh = Net::OpenSSH->new($opt->{'user'}.'@'.$opt->{'host'});
die "Couldn't establish SSH connection: ". $ssh->error if $ssh->error;
- my ($output, $errput) = $ssh->capture2($opt->{'command'});
+
+ my $ssh_opt = {};
+ $ssh_opt->{'stdin_data'} = $opt->{'stdin_string'}
+ if exists($opt->{'stdin_string'});
+ my ($output, $errput) = $ssh->capture2($ssh_opt, $opt->{'command'});
die "Error running SSH command: ". $ssh->error if $ssh->error;
die "Error running SSH command: ". $ssh->error if $ssh->error;
+
if ($errput && $opt->{'ignored_errors'} && length($opt->{'ignored_errors'})) {
my @ignored_errors = split('\n',$opt->{'ignored_errors'});
foreach my $ignored_error ( @ignored_errors ) {
if ($errput && $opt->{'ignored_errors'} && length($opt->{'ignored_errors'})) {
my @ignored_errors = split('\n',$opt->{'ignored_errors'});
foreach my $ignored_error ( @ignored_errors ) {