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 <bot@styleci.io>
This commit is contained in:
Tony Murray 2023-10-11 10:20:12 -05:00 committed by GitHub
parent 6e3261f801
commit a8b69c1393
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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 . ')]';