Fix NetBox 3 changed API keys

NetBoxAPI v3 deprecated attribute display_name
This commit is contained in:
Jan 2021-11-18 10:29:36 +00:00
parent 90b644f921
commit 1295947d5f

View File

@ -74,7 +74,7 @@ def net_nodes():
'firstseen': lastseen.isoformat(),
'lastseen': lastseen.isoformat(),
'nodeinfo': {
'hostname': node.display_name,
'hostname': node.name if node.name else f"Unnamed Device ({node.id})",
'node_id': str(node.id),
'network': { 'mac': node.name, 'addresses': addresses },
'mesh_interfaces': [node.name],