From a8b69c1393b68b2baf07c7b4b0d83b3ee1dfb64d Mon Sep 17 00:00:00 2001 From: Tony Murray Date: Wed, 11 Oct 2023 10:20:12 -0500 Subject: [PATCH] Fix discovery protocols again (#15434) * Fix discovery protocols again earlier fix had a typo fixes #15432 * Apply fixes from StyleCI --------- Co-authored-by: StyleCI Bot --- includes/discovery/functions.inc.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/includes/discovery/functions.inc.php b/includes/discovery/functions.inc.php index 1b22f55877..63669d26f8 100644 --- a/includes/discovery/functions.inc.php +++ b/includes/discovery/functions.inc.php @@ -12,6 +12,8 @@ * See COPYING for more details. */ +use App\Actions\Device\ValidateDeviceAndCreate; +use App\Models\Device; use App\Models\Eventlog; use App\Models\Ipv6Address; use App\Models\Ipv6Network; @@ -87,11 +89,11 @@ function discover_new_device($hostname, $device, $method, $interface = null) } try { - $remote_device = new \App\Models\Device([ + $remote_device = new Device([ 'hostname' => $hostname, 'poller_group' => $device['poller_group'], ]); - $result = \App\Actions\Device\ValidateDeviceAndCreate($remote_device)->execute(); + $result = (new ValidateDeviceAndCreate($remote_device))->execute(); if ($result) { echo '+[' . $remote_device->hostname . '(' . $remote_device->device_id . ')]';