Fix port_id is null in ospf poller (#9078)

set it to 0 instead of null
This commit is contained in:
Tony Murray 2018-08-24 16:45:27 -05:00 committed by GitHub
parent af300f7984
commit d46f300260
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -78,10 +78,10 @@ foreach ($vrfs_lite_cisco as $vrf_lite) {
foreach ($ospf_ports_poll as $ospf_port_id => $ospf_port) {
// find port_id
if ($ospf_port['ospfAddressLessIf']) {
$ospf_port['port_id'] = $device_model->ports()->where('ifIndex', $ospf_port['ospfAddressLessIf'])->value('port_id');
$ospf_port['port_id'] = (int)$device_model->ports()->where('ifIndex', $ospf_port['ospfAddressLessIf'])->value('port_id');
} else {
// FIXME force same device ?
$ospf_port['port_id'] = Ipv4Address::query()
$ospf_port['port_id'] = (int)Ipv4Address::query()
->where('ipv4_address', $ospf_port['ospfIfIpAddress'])
->where('context_name', $device['context_name'])
->value('port_id');