summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2008-09-15 00:40:18 +0000
committerivan <ivan>2008-09-15 00:40:18 +0000
commitf9befdcb5ce8cf5dc5b9cacb6fe04ce29ed3cb80 (patch)
tree2387985142a0d622bd450bc4f68ee802b082337e
parent92e4952763f6c4ab4fd9a773315653b389ba872f (diff)
add dry_run option to globalpops_voip export
-rw-r--r--FS/FS/part_export/globalpops_voip.pm33
1 files changed, 19 insertions, 14 deletions
diff --git a/FS/FS/part_export/globalpops_voip.pm b/FS/FS/part_export/globalpops_voip.pm
index 4213bd1..3bd5783 100644
--- a/FS/FS/part_export/globalpops_voip.pm
+++ b/FS/FS/part_export/globalpops_voip.pm
@@ -12,6 +12,7 @@ tie my %options, 'Tie::IxHash',
'login' => { label=>'GlobalPOPs Media Services API login' },
'password' => { label=>'GlobalPOPs Media Services API password' },
'endpointgroup' => { label=>'GlobalPOPs endpoint group number' },
+ 'dry_run' => { label=>"Test mode - don't actually provision" },
;
%info = (
@@ -253,6 +254,9 @@ sub gp_command {
sub _export_insert {
my( $self, $svc_phone ) = (shift, shift);
+
+ return '' if $self->option('dry_run');
+
#we want to provision and catch errors now, not queue
my $r = $self->gp_command('reserveDID',
@@ -295,6 +299,8 @@ sub _export_replace {
sub _export_delete {
my( $self, $svc_phone ) = (shift, shift);
+ return '' if $self->option('dry_run');
+
#probably okay to queue the deletion...?
#but hell, let's do it inline anyway, who wants phone numbers hanging around
@@ -325,20 +331,19 @@ sub _export_unsuspend {
}
#hmm, might forgo queueing entirely for most things, data is too much of a pita
-
-sub globalpops_voip_queue {
- my( $self, $svcnum, $method ) = (shift, shift, shift);
- my $queue = new FS::queue {
- 'svcnum' => $svcnum,
- 'job' => 'FS::part_export::globalpops_voip::globalpops_voip_command',
- };
- $queue->insert(
- $self->option('login'),
- $self->option('password'),
- $method,
- @_,
- );
-}
+#sub globalpops_voip_queue {
+# my( $self, $svcnum, $method ) = (shift, shift, shift);
+# my $queue = new FS::queue {
+# 'svcnum' => $svcnum,
+# 'job' => 'FS::part_export::globalpops_voip::globalpops_voip_command',
+# };
+# $queue->insert(
+# $self->option('login'),
+# $self->option('password'),
+# $method,
+# @_,
+# );
+#}
sub globalpops_voip_command {
my($login, $password, $method, @args) = @_;