[freeside-commits] branch master updated. af0bf1fd5b9cb1316d6e34bff0ed41061e14443d

Ivan ivan at 420.am
Wed Dec 9 16:56:01 PST 2015


The branch, master has been updated
       via  af0bf1fd5b9cb1316d6e34bff0ed41061e14443d (commit)
      from  f263d9c5f3fa07442faadd9000aaad7275892f8e (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit af0bf1fd5b9cb1316d6e34bff0ed41061e14443d
Author: Ivan Kohler <ivan at freeside.biz>
Date:   Wed Dec 9 16:55:58 2015 -0800

    deal when Net::MAC::Vendor-lookup doesn't return an arrayref, RT#39384

diff --git a/httemplate/view/elements/svc_Common.html b/httemplate/view/elements/svc_Common.html
index d7a1dcf..296c27b 100644
--- a/httemplate/view/elements/svc_Common.html
+++ b/httemplate/view/elements/svc_Common.html
@@ -283,8 +283,8 @@ my $format_field = sub {
   } elsif ( $type eq 'checkbox' ) {
     $value = $value eq 'Y' ? emt('Yes') : emt('No');
   } elsif ( $type =~ /(input-)?mac_addr/ and $value =~ /\w/) {
-    my $vendor = Net::MAC::Vendor::lookup($value)->[0];
-    $value .= " ($vendor)" if $vendor;
+    my $vendor = Net::MAC::Vendor::lookup($value);
+    $value .= ' ('. $vendor->[0]. ')' if $vendor;
     $value = $m->scomp('/elements/mac_addr.html', $value);
   }
 
diff --git a/httemplate/view/elements/svc_devices.html b/httemplate/view/elements/svc_devices.html
index 899e6aa..3d4e1bb 100644
--- a/httemplate/view/elements/svc_devices.html
+++ b/httemplate/view/elements/svc_devices.html
@@ -63,7 +63,8 @@
             <% $td %><% $device->part_device->devicename |h %></TD>
 %         }
           <% $td %><% $device->mac_addr_pretty %>
-                 (<% (Net::MAC::Vendor::lookup($device->mac_addr_formatted('U',':')))->[0] %>)
+%                my $vendor = Net::MAC::Vendor::lookup($device->mac_addr_formatted('U',':'));
+                 (<% $vendor ? $vendor->[0] : '' %>)
           </TD>
           <% $td %><% $export_links %></TD>
           <% $td %>(
diff --git a/httemplate/view/elements/svc_radius_usage.html b/httemplate/view/elements/svc_radius_usage.html
index 4719691..5619852 100644
--- a/httemplate/view/elements/svc_radius_usage.html
+++ b/httemplate/view/elements/svc_radius_usage.html
@@ -27,8 +27,11 @@
 %  ) / 1073741824;
 %
 %  my $last_mac = $svc->attribute_last_sqlradacct( 'CallingStationId' );
-%  if ( $last_mac =~ /^\s*(([\dA-F]{2}[\-:]){5}[\dA-F]{2})/i ) {
-%    $last_mac .= ' ('. (Net::MAC::Vendor::lookup($1))->[0]. ')';
+%  if (    $last_mac =~ /^\s*(([\dA-F]{2}[\-:]){5}[\dA-F]{2})/i
+%       && my $vendor = Net::MAC::Vendor::lookup($1)
+%     )
+%  {
+%    $last_mac .= ' ('. $vendor->[0]. ')';
 %  }
 
 

-----------------------------------------------------------------------

Summary of changes:
 httemplate/view/elements/svc_Common.html       |    4 ++--
 httemplate/view/elements/svc_devices.html      |    3 ++-
 httemplate/view/elements/svc_radius_usage.html |    7 +++++--
 3 files changed, 9 insertions(+), 5 deletions(-)




More information about the freeside-commits mailing list