[freeside-commits] branch master updated. a98d391396726b9459f7266cde26ff3b76924447

Jonathan Prykop jonathan at 420.am
Thu Jan 21 15:35:34 PST 2016


The branch, master has been updated
       via  a98d391396726b9459f7266cde26ff3b76924447 (commit)
      from  e877b3248acbff4fa9fb5606e878175577c332d3 (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 a98d391396726b9459f7266cde26ff3b76924447
Author: Jonathan Prykop <jonathan at freeside.biz>
Date:   Thu Jan 21 17:35:10 2016 -0600

    RT#39115: View SNMP info on svc_broadband service [bug fixes to previous]

diff --git a/FS/FS/part_export/broadband_snmp_get.pm b/FS/FS/part_export/broadband_snmp_get.pm
index 18ba8ea..1a86612 100644
--- a/FS/FS/part_export/broadband_snmp_get.pm
+++ b/FS/FS/part_export/broadband_snmp_get.pm
@@ -96,18 +96,19 @@ sub snmp_results {
     if ($vers eq '1') {
       my $varbind = new SNMP::Varbind [$oid];
       my $max = 1000; #sanity check
-      while ($max > 0 and $snmp->getnext($varbind)) {
+      while ($max > 0 and defined($snmp->getnext($varbind))) {
         last if $snmp->{'ErrorStr'};
         last unless $SNMP::MIB{$varbind->[0]}; # does this happen?
         my $nextoid = $SNMP::MIB{$varbind->[0]}->{'objectID'};
         last unless $nextoid =~ /^$oid/;
         $max--;
-        push @values, new SNMP::Varbind [ @$varbind ];
+        push @values, [ @$varbind ];
       }
     } else {
       # not clear on what max-repeaters (25) does, plucked value from example code
       # but based on testing, it isn't capping number of returned values
-      @values = $snmp->bulkwalk(0,25,$oid);
+      my ($values) = $snmp->bulkwalk(0,25,$oid);
+      @values = @$values if $values;
     }
     if ($snmp->{'ErrorStr'} || !@values) {
       push @out, { 'error' => $snmp->{'ErrorStr'} || 'No values retrieved' };

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

Summary of changes:
 FS/FS/part_export/broadband_snmp_get.pm |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)




More information about the freeside-commits mailing list