[freeside-commits] branch FREESIDE_4_BRANCH updated. 9e99a610a2c69db3ab9f42728ab6dbf492a5496a

Jonathan Prykop jonathan at 420.am
Wed Sep 30 18:00:23 PDT 2015


The branch, FREESIDE_4_BRANCH has been updated
       via  9e99a610a2c69db3ab9f42728ab6dbf492a5496a (commit)
      from  f1013e0350ff3793f00a05ba272b72287727918c (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 9e99a610a2c69db3ab9f42728ab6dbf492a5496a
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Wed Sep 30 01:43:44 2015 -0500

    RT#37547: Voice Network FS reexport

diff --git a/FS/bin/freeside-reexport b/FS/bin/freeside-reexport
index 54af9dd..6b68917 100644
--- a/FS/bin/freeside-reexport
+++ b/FS/bin/freeside-reexport
@@ -1,7 +1,7 @@
 #!/usr/bin/perl -w
 
 use strict;
-use vars qw($opt_s $opt_u $opt_p);
+use vars qw($opt_s $opt_u $opt_p $opt_e);
 use Getopt::Std;
 use FS::UID qw(adminsuidsetup);
 use FS::Record qw(qsearch qsearchs);
@@ -22,7 +22,7 @@ if ( $export_x =~ /^(\d+)$/ ) {
     or die "no exports of type $export_x found\n";
 }
 
-getopts('s:u:p:');
+getopts('s:u:p:e:');
 
 my @svc_x = ();
 if ( $opt_s ) {
@@ -38,16 +38,20 @@ if ( $opt_s ) {
   die "no services with svcpart $opt_p found\n" unless @svc_x;
 }
 
+$opt_e ||= 'insert';
+die &usage unless grep { $_ eq $opt_e } qw( insert replace delete suspend unsuspend );
+my $method = 'export_' . $opt_e;
+
 foreach my $part_export ( @part_export ) {
   foreach my $svc_x ( @svc_x ) {
-    my $error = $part_export->export_insert($svc_x);
+    my $error = $part_export->$method($svc_x,$svc_x);
     die $error if $error;
   }
 }
 
 
 sub usage {
-  die "Usage:\n\n  freeside-reexport user exportnum|exporttype [ -s svcnum | -u username | -p svcpart ]\n";
+  return "Usage:\n\n  freeside-reexport user exportnum|exporttype [ -s svcnum | -u username | -p svcpart ] [ -e insert|replace|delete|suspend|unsuspend ]\n";
 }
 
 =head1 NAME
@@ -56,12 +60,13 @@ freeside-reexport - Command line tool to re-trigger export jobs for existing ser
 
 =head1 SYNOPSIS
 
-  freeside-reexport user exportnum|exporttype [ -s svcnum | -u username | -p svcpart ]
+  freeside-reexport user exportnum|exporttype [ -s svcnum | -u username | -p svcpart ] [ -e insert|replace|delete|suspend|unsuspend ]
 
 =head1 DESCRIPTION
 
   Re-queues the export job for the specified exportnum or exporttype(s) and
-  specified service (selected by svcnum or username).
+  specified service (selected by svcnum, username or svcpart).  Optionally 
+  specify the phase of export using the -e flag (default is insert.)
 
 =head1 SEE ALSO
 

-----------------------------------------------------------------------

Summary of changes:
 FS/bin/freeside-reexport |   17 +++++++++++------
 1 file changed, 11 insertions(+), 6 deletions(-)




More information about the freeside-commits mailing list