[freeside-commits] freeside/FS/FS svc_broadband.pm, 1.20, 1.21 Schema.pm, 1.153, 1.154 Conf.pm, 1.295, 1.296

Ivan,,, ivan at wavetail.420.am
Tue Jul 7 02:23:22 PDT 2009


Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv963/FS/FS

Modified Files:
	svc_broadband.pm Schema.pm Conf.pm 
Log Message:
allow null svc_broadband.ip_addr

Index: Schema.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Schema.pm,v
retrieving revision 1.153
retrieving revision 1.154
diff -u -d -r1.153 -r1.154
--- Schema.pm	5 Jul 2009 21:35:51 -0000	1.153
+++ Schema.pm	7 Jul 2009 09:23:20 -0000	1.154
@@ -1763,7 +1763,7 @@
         'blocknum', 'int', '', '', '', '', 
         'speed_up', 'int', '', '', '', '', 
         'speed_down', 'int', '', '', '', '', 
-        'ip_addr', 'varchar', '', 15, '', '', 
+        'ip_addr', 'varchar', 'NULL', 15, '', '', 
         'mac_addr', 'varchar', 'NULL', 12, '', '', 
         'authkey',  'varchar', 'NULL', 32, '', '', 
         'latitude', 'decimal', 'NULL', '', '', '', 

Index: Conf.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/Conf.pm,v
retrieving revision 1.295
retrieving revision 1.296
diff -u -d -r1.295 -r1.296
--- Conf.pm	29 Jun 2009 13:53:23 -0000	1.295
+++ Conf.pm	7 Jul 2009 09:23:20 -0000	1.296
@@ -2835,6 +2835,14 @@
     'type'        => 'text',
   },
 
+  #more fine-grained, service def-level control could be useful eventually?
+  {
+    'key'         => 'svc_broadband-allow_null_ip_addr',
+    'section'     => '',
+    'description' => '',
+    'type'        => 'checkbox',
+  },
+
   {
     'key'         => 'tax-report_groups',
     'section'     => '',

Index: svc_broadband.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_broadband.pm,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- svc_broadband.pm	16 Mar 2009 08:08:44 -0000	1.20
+++ svc_broadband.pm	7 Jul 2009 09:23:20 -0000	1.21
@@ -246,7 +246,19 @@
     }
   }
 
+  $error = $self->_check_ip_addr;
+  return $error if $error;
+
+  $self->SUPER::check;
+}
+
+sub _check_ip_addr {
+  my $self = shift;
+
   if (not($self->ip_addr) or $self->ip_addr eq '0.0.0.0') {
+
+    return '' if $conf->exists('svc_broadband-allow_null_ip_addr'); #&& !$self->blocknum
+
     return "Must supply either address or block"
       unless $self->blocknum;
     my $next_addr = $self->addr_block->next_free_addr;
@@ -255,6 +267,7 @@
     } else {
       return "No free addresses in addr_block (blocknum: ".$self->blocknum.")";
     }
+
   }
 
   if (not($self->blocknum)) {
@@ -288,7 +301,7 @@
     return 'Router '.$router->routernum.' cannot provide svcpart '.$self->svcpart;
   }
 
-  $self->SUPER::check;
+  '';
 }
 
 sub _check_duplicate {



More information about the freeside-commits mailing list