Changed order of printing Netbox version. It makes sense to print it when a succesfull session with authentication is present. This fixes a bug where the version is printed even though the token might be invalid which might cause confusion.

This commit is contained in:
TheNetworkGuy
2026-02-25 09:05:21 +01:00
parent 9ec8bb3c2c
commit 0a37ff491c
+1 -1
View File
@@ -88,10 +88,10 @@ class Sync:
try:
# Get NetBox version
nb_version = netbox.version
logger.debug("NetBox version is %s.", nb_version)
# Test API access by attempting to access a basic endpoint
# This will catch authorization errors early
netbox.dcim.devices.count()
logger.debug("NetBox version is %s.", nb_version)
self.netbox = netbox
self.nb_version = nb_version
except RequestsConnectionError: