[freeside-commits] freeside/FS/FS svc_Common.pm,1.62.2.3,1.62.2.4
Ivan,,,
ivan at wavetail.420.am
Sun Dec 18 17:18:12 PST 2011
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv17346
Modified Files:
Tag: FREESIDE_2_3_BRANCH
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.62.2.3
retrieving revision 1.62.2.4
diff -u -w -d -r1.62.2.3 -r1.62.2.4
--- svc_Common.pm 9 Dec 2011 05:09:20 -0000 1.62.2.3
+++ svc_Common.pm 19 Dec 2011 01:18:10 -0000 1.62.2.4
@@ -161,6 +161,16 @@
$self->label(@_);
}
+sub cust_main {
+ my $self = shift;
+ (($self->cust_svc || return)->cust_pkg || return)->cust_main || return
+}
+
+sub cust_linked {
+ my $self = shift;
+ defined($self->cust_main);
+}
+
=item check
Checks the validity of fields in this record.
@@ -318,7 +328,11 @@
}
- $self->nms_ip_insert;
+ 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;
@@ -1175,9 +1189,12 @@
$conf->config('nms-auto_add-svc_ips');
my $ip_field = $self->table_info->{'ip_field'};
- #XXX perhaps i should be job-queued, i take awhile, right?
- my $nms = new FS::NetworkMonitoringSystem;
- $nms->add_router( $self->$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')
);
}
More information about the freeside-commits
mailing list