[freeside-commits] freeside/FS/FS/part_export shellcommands.pm, 1.46, 1.47

Mark Wells mark at wavetail.420.am
Thu Jul 30 00:35:20 PDT 2009


Update of /home/cvs/cvsroot/freeside/FS/FS/part_export
In directory wavetail.420.am:/tmp/cvs-serv1168

Modified Files:
	shellcommands.pm 
Log Message:
Make no_queue option work correctly

Index: shellcommands.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/part_export/shellcommands.pm,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -d -r1.46 -r1.47
--- shellcommands.pm	28 Jul 2009 02:12:50 -0000	1.46
+++ shellcommands.pm	30 Jul 2009 07:35:18 -0000	1.47
@@ -301,13 +301,23 @@
   $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 {



More information about the freeside-commits mailing list