summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormark <mark>2009-07-30 07:35:18 +0000
committermark <mark>2009-07-30 07:35:18 +0000
commit57c08db01160c72aaada973a62f7b3a2e3cbd544 (patch)
tree94ea8a5ce9d26cd3c14289554b8c0532dd846464
parentda635762c054395a44145362f1ddd2ccdbb87416 (diff)
Make no_queue option work correctly
-rw-r--r--FS/FS/part_export/shellcommands.pm22
1 files changed, 16 insertions, 6 deletions
diff --git a/FS/FS/part_export/shellcommands.pm b/FS/FS/part_export/shellcommands.pm
index e375302a4..11e3b7d4b 100644
--- a/FS/FS/part_export/shellcommands.pm
+++ b/FS/FS/part_export/shellcommands.pm
@@ -301,13 +301,23 @@ sub _export_command {
$ldap_password = shell_quote $ldap_password;
my $command_string = eval(qq("$command"));
-
- $self->shellcommands_queue( $svc_acct->svcnum,
- user => $self->option('user')||'root',
- host => $self->machine,
- command => $command_string,
- stdin_string => $stdin_string,
+ my @ssh_cmd_args = (
+ user => $self->option('user') || 'root',
+ host => $self->machine,
+ command => $command_string,
+ stdin_string => $stdin_string,
);
+
+ if($self->options('no_queue')) {
+ # discard return value just like freeside-queued.
+ eval { ssh_cmd(@ssh_cmd_args) };
+ $error = $@;
+ return $error. ' ('. $self->exporttype. ' to '. $self->machine. ')'
+ if $error;
+ }
+ else {
+ $self->shellcommands_queue( $new->svcnum, @ssh_cmd_args );
+ }
}
sub _export_replace {