mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
New utility Number::constrainInteger() (#15663)
* New utility Number::constrainInteger() Fixes a bug with Number::unsignedAsSigned() and implements signed support as well. * cleanup * Apply fixes from StyleCI * Remove default cases --------- Co-authored-by: StyleCI Bot <bot@styleci.io>
This commit is contained in:
@@ -32,6 +32,7 @@ use App\Models\PortVdsl;
|
||||
use App\Observers\ModuleModelObserver;
|
||||
use Illuminate\Support\Collection;
|
||||
use LibreNMS\DB\SyncsModels;
|
||||
use LibreNMS\Enum\IntegerType;
|
||||
use LibreNMS\Interfaces\Data\DataStorageInterface;
|
||||
use LibreNMS\Interfaces\Module;
|
||||
use LibreNMS\OS;
|
||||
@@ -139,7 +140,7 @@ class Xdsl implements Module
|
||||
if (isset($data[$oid])) {
|
||||
if ($oid == 'adslAtucCurrOutputPwr') {
|
||||
// workaround Cisco Bug CSCvj53634
|
||||
$data[$oid] = Number::unsignedAsSigned($data[$oid]);
|
||||
$data[$oid] = Number::constrainInteger($data[$oid], IntegerType::int32);
|
||||
}
|
||||
$data[$oid] = $data[$oid] / 10;
|
||||
}
|
||||
|
Reference in New Issue
Block a user