OSPF instances and missing mandatory fields fix attempt (#15712)

* dirty fix

* better fix

* more column checks

* double check not necessary

* get out of both loops
This commit is contained in:
PipoCanaja
2024-01-15 23:45:59 +01:00
committed by GitHub
parent 598857c6ef
commit f115de989e

View File

@@ -87,6 +87,11 @@ class Ospf implements Module
if (empty($ospf_entry['ospfRouterId'])) {
continue; // skip invalid data
}
foreach (['ospfRxNewLsas', 'ospfOriginateNewLsas', 'ospfAreaBdrRtrStatus', 'ospfTOSSupport', 'ospfExternLsaCksumSum', 'ospfExternLsaCount', 'ospfASBdrRtrStatus', 'ospfVersionNumber', 'ospfAdminStat'] as $column) {
if (! array_key_exists($column, $ospf_entry) || is_null($ospf_entry[$column])) {
continue 2; // This column must exist and not be null
}
}
$instance = OspfInstance::updateOrCreate([
'device_id' => $os->getDeviceId(),