Skip to content

Commit

Permalink
Fix some changes to NIC being lost before save()
Browse files Browse the repository at this point in the history
  • Loading branch information
ribetm committed Jan 21, 2025
1 parent 6ba1e1f commit 0eeedc7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions netbox_agent/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,6 +482,10 @@ def batched(it, n):
interface = self.create_netbox_nic(nic)

nic_update = 0

ret, interface = self.reset_vlan_on_interface(nic, interface)
nic_update += ret

if nic["name"] != interface.name:
logging.info(
"Updating interface {interface} name to: {name}".format(
Expand All @@ -500,9 +504,6 @@ def batched(it, n):
interface.mac = nic["mac"]
nic_update += 1

ret, interface = self.reset_vlan_on_interface(nic, interface)
nic_update += ret

if hasattr(interface, "mtu"):
if nic["mtu"] != interface.mtu:
logging.info(
Expand Down

0 comments on commit 0eeedc7

Please sign in to comment.