File tree Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Expand file tree Collapse file tree 1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 1515import importlib
1616import logging
1717import socket
18-
18+ from dcim . models import Platform
1919from django .conf import settings
2020from napalm import get_network_driver
2121from napalm .base .exceptions import ConnectionException , CommandErrorException
2525from netmiko .ssh_exception import NetMikoTimeoutException
2626from paramiko .ssh_exception import SSHException
2727
28- from dcim .models import Platform
29-
3028from netbox_onboarding .onboarding .onboarding import StandaloneOnboarding
3129from .constants import NETMIKO_TO_NAPALM_STATIC
3230from .exceptions import OnboardException
@@ -178,7 +176,12 @@ def guess_netmiko_device_type(self):
178176 logger .error ("ERROR: %s" , str (err ))
179177 raise OnboardException (reason = "fail-general" , message = f"ERROR: { str (err )} " )
180178
181- logger .info ("INFO device type is: %s" , guessed_device_type )
179+ else :
180+ if guessed_device_type is None :
181+ logger .error ("ERROR: Could not detect device type with SSHDetect" )
182+ raise OnboardException (
183+ reason = "fail-general" , message = "ERROR: Could not detect device type with SSHDetect"
184+ )
182185
183186 return guessed_device_type
184187
You can’t perform that action at this time.
0 commit comments