summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2009-07-14 02:53:57 +0000
committerivan <ivan>2009-07-14 02:53:57 +0000
commitb898dc674b2d5158a2ecccd3424ad2ea7dc264e0 (patch)
tree81c8ca51de3c77bdb7e04a93ac796ef5432a0bf2 /FS
parentef0d1ce08b8575fbb079f1700330c579e36691c4 (diff)
fix netsapiens device provisioning? or at least better debugging, RT#5226
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/part_export/netsapiens.pm10
1 files changed, 8 insertions, 2 deletions
diff --git a/FS/FS/part_export/netsapiens.pm b/FS/FS/part_export/netsapiens.pm
index eea2509cc..9181344fb 100644
--- a/FS/FS/part_export/netsapiens.pm
+++ b/FS/FS/part_export/netsapiens.pm
@@ -1,12 +1,13 @@
package FS::part_export::netsapiens;
-use vars qw(@ISA %info);
+use vars qw(@ISA $me %info);
use URI;
use MIME::Base64;
use Tie::IxHash;
use FS::part_export;
@ISA = qw(FS::part_export);
+$me = '[FS::part_export::netsapiens]';
tie my %options, 'Tie::IxHash',
'login' => { label=>'NetSapiens tac2 User API username' },
@@ -16,6 +17,7 @@ tie my %options, 'Tie::IxHash',
'device_password' => { label=>'NetSapiens tac2 Device API password' },
'device_url' => { label=>'NetSapiens tac2 Device URL' },
'domain' => { label=>'NetSapiens Domain' },
+ 'debug' => { label=>'Enable debugging', type=>'checkbox' },
;
%info = (
@@ -38,7 +40,7 @@ sub ns_command {
sub ns_device_command {
my $self = shift;
- $self->_ns_command('device', @_);
+ $self->_ns_command('device_', @_);
}
sub _ns_command {
@@ -59,6 +61,10 @@ sub _ns_command {
$args[0] .= $ns->buildQuery( { @_ } );
}
+ warn "$me $method ". $self->option($prefix.'url').
+ " $command ". join(', ', @_). "\n"
+ if $self->option('debug');
+
my $auth = encode_base64( $self->option($prefix.'login'). ':'.
$self->option($prefix.'password') );
push @args, { 'Authorization' => "Basic $auth" };