AttributeError: 'NoneType' object has no attribute 'mode' #226
Labels
No labels
help wanted
need testing
status: accepted
status: discussing
type: bug
type: documentation
type: duplicate
type: enhancement
type:hardware
type: invalid
type: major feature
type: minor feature
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: DGNum/netbox-agent#226
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
When running:
python3 -m netbox_agent.cli --hostname_cmd "hostname -f" -c ../netbox_agent.yml -u --preserve-tags
i get
443 "GET /api/dcim/interfaces/?id=929&limit=0 HTTP/1.1" 200 52 Traceback (most recent call last): File "/usr/lib/python3.8/runpy.py", line 194, in _run_module_as_main return _run_code(code, main_globals, None, File "/usr/lib/python3.8/runpy.py", line 87, in _run_code exec(code, run_globals) File "/opt/netbox-agent/netbox_agent/cli.py", line 54, in <module> main() File "/opt/netbox-agent/netbox_agent/cli.py", line 50, in main return run(config) File "/opt/netbox-agent/netbox_agent/cli.py", line 43, in run server.netbox_create_or_update(config) File "/opt/netbox-agent/netbox_agent/virtualmachine.py", line 108, in netbox_create_or_update self.network.create_or_update_netbox_network_cards() File "/opt/netbox-agent/netbox_agent/network.py", line 443, in create_or_update_netbox_network_cards ret, interface = self.reset_vlan_on_interface(nic, interface) File "/opt/netbox-agent/netbox_agent/network.py", line 222, in reset_vlan_on_interface (interface.mode is not None or len(interface.tagged_vlans) > 0): AttributeError: 'NoneType' object has no attribute 'mode'
@cyrinux this is a old bug ,
line 217 replace with self.nb_net
@KivraChristoffer Replace what to what? please give me the correct line here.
@devopstales
network.py
215 # For strange reason, we need to get the object from scratch
216 # The object returned by pynetbox's save isn't always working (since pynetbox 6)
217 interface = nb.dcim.interfaces.get(id=interface.id) <---- interface = self.nb_net.interfaces.get(id=interface.id)
this is still not merged to master :)
addressed in #232