[freeside-commits] freeside/FS/FS svc_Common.pm,1.65,1.66
Ivan,,,
ivan at wavetail.420.am
Sun Dec 18 17:18:09 PST 2011
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv17317
Modified Files:
svc_Common.pm
Log Message:
missing commit from nms auto-addition fixes, RT#15536
Index: svc_Common.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_Common.pm,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -w -d -r1.65 -r1.66
--- svc_Common.pm 11 Nov 2011 23:55:30 -0000 1.65
+++ svc_Common.pm 19 Dec 2011 01:18:06 -0000 1.66
@@ -5,6 +5,7 @@
$overlimit_missing_cust_svc_nonfatal_kludge );
use Carp qw( cluck carp croak confess ); #specify cluck have to specify them all
use Scalar::Util qw( blessed );
+use FS::Conf;
use FS::Record qw( qsearch qsearchs fields dbh );
use FS::cust_main_Mixin;
use FS::cust_svc;
@@ -13,6 +14,7 @@
use FS::cust_main;
use FS::inventory_item;
use FS::inventory_class;
+use FS::NetworkMonitoringSystem;
@ISA = qw( FS::cust_main_Mixin FS::Record );
@@ -326,6 +328,12 @@
}
+ my $nms_ip_error = $self->nms_ip_insert;
+ if ( $nms_ip_error ) {
+ $dbh->rollback if $oldAutoCommit;
+ return "error queuing IP insert: $nms_ip_error";
+ }
+
if ( exists $options{'jobnums'} ) {
push @{ $options{'jobnums'} }, @jobnums;
}
@@ -1170,6 +1178,35 @@
}
+=item nms_ip_insert
+
+=cut
+
+sub nms_ip_insert {
+ my $self = shift;
+ my $conf = new FS::Conf;
+ return '' unless grep { $self->table eq $_ }
+ $conf->config('nms-auto_add-svc_ips');
+ my $ip_field = $self->table_info->{'ip_field'};
+
+ my $queue = FS::queue->new( {
+ 'job' => 'FS::NetworkMonitoringSystem::queued_add_router',
+ 'svcnum' => $self->svcnum,
+ } );
+ $queue->insert( 'FS::NetworkMonitoringSystem',
+ $self->$ip_field(),
+ $conf->config('nms-auto_add-community')
+ );
+}
+
+=item nms_delip
+
+=cut
+
+sub nms_ip_delete {
+#XXX not yet implemented
+}
+
=back
=head1 BUGS
More information about the freeside-commits
mailing list