mirror of
https://github.com/TheNetworkGuy/netbox-zabbix-sync.git
synced 2026-03-21 12:08:39 -06:00
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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user