From 57c08db01160c72aaada973a62f7b3a2e3cbd544 Mon Sep 17 00:00:00 2001 From: mark Date: Thu, 30 Jul 2009 07:35:18 +0000 Subject: [PATCH] Make no_queue option work correctly --- FS/FS/part_export/shellcommands.pm | 22 ++++++++++++++++------ 1 file 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 { -- 2.11.0