change minimum netbox version for compatibility now we use new cable system

This commit is contained in:
Solvik Blum 2023-08-18 17:21:39 +02:00
parent 089f893b7c
commit f76670f227
No known key found for this signature in database
GPG key ID: 9EBAFE7BBDFBAAE2

View file

@ -19,6 +19,7 @@ MANUFACTURERS = {
'Generic': GenericHost, 'Generic': GenericHost,
} }
MIN_NETBOX_VERSION = '3.3'
def run(config): def run(config):
dmi = dmidecode.parse() dmi = dmidecode.parse()
@ -34,8 +35,8 @@ def run(config):
except KeyError: except KeyError:
server = GenericHost(dmi=dmi) server = GenericHost(dmi=dmi)
if version.parse(nb.version) < version.parse('2.9'): if version.parse(nb.version) < version.parse(MIN_NETBOX_VERSION):
print('netbox-agent is not compatible with Netbox prior to verison 2.9') print(f'netbox-agent is not compatible with Netbox prior to verison {MIN_NETBOX_VERSION}')
return False return False
if config.register or config.update_all or config.update_network or \ if config.register or config.update_all or config.update_network or \