RT# 78547 noexport_hack - part_svc::grandstream
authorMitch Jackson <mitch@mitchjacksontech.com>
Tue, 14 Aug 2018 23:27:57 +0000 (19:27 -0400)
committerMitch Jackson <mitch@freeside.biz>
Wed, 15 Aug 2018 00:26:39 +0000 (20:26 -0400)
FS/FS/part_export/grandstream.pm

index 5c6f1ed..981eb19 100644 (file)
@@ -7,6 +7,7 @@ use MIME::Base64;
 use Tie::IxHash;
 use IPC::Run qw(run);
 use FS::CGI qw(rooturl);
+use Carp qw(carp);
 
 $DEBUG = 0;
 
@@ -50,6 +51,12 @@ sub rebless { shift; }
 sub gs_create_config {
   my($self, $mac, %opt) = (@_);
 
+  if ( $FS::svc_Common::noexport_hack ) {
+    carp 'gs_create_config() suppressed by noexport_hack'
+      if $self->option('debug') || $DEBUG;
+    return;
+  }
+
   eval "use Net::SCP;";
   die $@ if $@;
 
@@ -131,6 +138,12 @@ sub gs_create {
 sub gs_delete {
   my($self, $mac) = (shift, shift);
 
+  if ( $FS::svc_Common::noexport_hack ) {
+    carp 'gs_delete() suppressed by noexport_hack'
+      if $self->option('debug') || $DEBUG;
+    return;
+  }
+
   $mac = sprintf('%012s', lc($mac));
 
   ssh_cmd( user => $self->option('user'),