X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fpart_export%2Fprizm.pm;h=6a0554b6c23a8cfba8979ab6d59ba11f18803e3a;hb=e281c64b7dc78502cda21b4f4a9b22cfcf848801;hp=2d4d8584c3091c0f6f89c05391fb2662b30e4632;hpb=d6d4c7f87fa73da09775cc7c257d89b9a2085ea7;p=freeside.git diff --git a/FS/FS/part_export/prizm.pm b/FS/FS/part_export/prizm.pm index 2d4d8584c..6a0554b6c 100644 --- a/FS/FS/part_export/prizm.pm +++ b/FS/FS/part_export/prizm.pm @@ -1,12 +1,13 @@ package FS::part_export::prizm; -use vars qw(@ISA %info %options $DEBUG); +use vars qw(@ISA %info %options $DEBUG $me); use Tie::IxHash; use FS::Record qw(fields dbh); use FS::part_export; @ISA = qw(FS::part_export); -$DEBUG = 1; +$DEBUG = 0; +$me = '[' . __PACKAGE__ . ']'; tie %options, 'Tie::IxHash', 'url' => { label => 'Northbound url', default=>'https://localhost:8443/prizm/nbi' }, @@ -125,6 +126,9 @@ sub queued_prizm_command { # subroutine sub _export_insert { my( $self, $svc ) = ( shift, shift ); + warn "$me: _export_insert called for export ". $self->exportnum. + " on service ". $svc->svcnum. "\n" + if $DEBUG; my $cust_main = $svc->cust_svc->cust_pkg->cust_main; @@ -151,6 +155,7 @@ sub _export_insert { my $pcustomer; if ($err_or_som->result->[0]) { $pcustomer = $err_or_som->result->[0]->customerId; + warn "$me: found customer $pcustomer in prizm\n" if $DEBUG; }else{ my $chashref = $cust_main->hashref; my $customerinfo = { @@ -177,6 +182,7 @@ sub _export_insert { unless ref($err_or_som); $pcustomer = $err_or_som->result; + warn "$me: added customer $pcustomer to prizm\n" if $DEBUG; } warn "multiple prizm customers found for $cust_main->custnum" if scalar(@$pcustomer) > 1; @@ -200,6 +206,9 @@ sub _export_insert { # } # } + my $performance_profile = $svc->performance_profile; + $performance_profile ||= $svc->cust_svc->cust_pkg->part_pkg->pkg; + my $element_name_length = 50; $element_name_length = $1 if $self->option('element_name_length') =~ /^\s*(\d+)\s*$/; @@ -210,13 +219,14 @@ sub _export_insert { 0, $element_name_length), $location, $contact, - sprintf("%032X", $svc->authkey), - $svc->cust_svc->cust_pkg->part_pkg->pkg, + sprintf("%032X", $svc->authkey || 0), + $performance_profile, $svc->vlan_profile, ($self->option('ems') ? 1 : 0 ), ); return $err_or_som unless ref($err_or_som); + warn "$me: added provisioned element to prizm\n" if $DEBUG; my (@names) = ('Management IP', 'GPS Latitude', @@ -244,6 +254,7 @@ sub _export_insert { ); return $err_or_som unless ref($err_or_som); + warn "$me: set element configuration\n" if $DEBUG; $err_or_som = $self->prizm_command('NetworkIfService', 'setElementConfigSet', [ $element ], @@ -253,15 +264,17 @@ sub _export_insert { ); return $err_or_som unless ref($err_or_som); + warn "$me: set element vlan profile\n" if $DEBUG; $err_or_som = $self->prizm_command('NetworkIfService', 'setElementConfigSet', [ $element ], - $svc->cust_svc->cust_pkg->part_pkg->pkg, + $performance_profile, 0, 1, ); return $err_or_som unless ref($err_or_som); + warn "$me: set element configset (performance profile)\n" if $DEBUG; $err_or_som = $self->prizm_command('NetworkIfService', 'activateNetworkElements', @@ -272,6 +285,7 @@ sub _export_insert { return $err_or_som unless ref($err_or_som); + warn "$me: activated element\n" if $DEBUG; $err_or_som = $self->prizm_command('CustomerIfService', 'addElementToCustomer', @@ -283,6 +297,7 @@ sub _export_insert { return $err_or_som unless ref($err_or_som); + warn "$me: added element to customer\n" if $DEBUG; ''; } @@ -395,9 +410,12 @@ sub _export_replace { return $err_or_som unless ref($err_or_som); + my $performance_profile = $new->performance_profile; + $performance_profile ||= $new->cust_svc->cust_pkg->part_pkg->pkg; + $err_or_som = $self->prizm_command('NetworkIfService', 'setElementConfigSet', [ $element ], - $new->cust_svc->cust_pkg->part_pkg->pkg, + $performance_profile, 0, 1, ); @@ -475,7 +493,8 @@ sub _export_unsuspend { sub export_links { my( $self, $svc, $arrayref ) = ( shift, shift, shift ); - push @$arrayref, 'SM'; + push @$arrayref, + 'SM'; ''; }