File tree 1 file changed +7
-4
lines changed
1 file changed +7
-4
lines changed Original file line number Diff line number Diff line change 15
15
import importlib
16
16
import logging
17
17
import socket
18
-
18
+ from dcim . models import Platform
19
19
from django .conf import settings
20
20
from napalm import get_network_driver
21
21
from napalm .base .exceptions import ConnectionException , CommandErrorException
25
25
from netmiko .ssh_exception import NetMikoTimeoutException
26
26
from paramiko .ssh_exception import SSHException
27
27
28
- from dcim .models import Platform
29
-
30
28
from netbox_onboarding .onboarding .onboarding import StandaloneOnboarding
31
29
from .constants import NETMIKO_TO_NAPALM_STATIC
32
30
from .exceptions import OnboardException
@@ -178,7 +176,12 @@ def guess_netmiko_device_type(self):
178
176
logger .error ("ERROR: %s" , str (err ))
179
177
raise OnboardException (reason = "fail-general" , message = f"ERROR: { str (err )} " )
180
178
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
+ )
182
185
183
186
return guessed_device_type
184
187
You can’t perform that action at this time.
0 commit comments