Skip to content

Commit f9f1ee9

Browse files
authored
Interfaces extractor modifies the inventory as it processes tags. Copy the variable first to fix it. (#556)
1 parent 3679960 commit f9f1ee9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

plugins/inventory/nb_inventory.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,6 +258,7 @@
258258
import json
259259
import uuid
260260
import math
261+
from copy import deepcopy
261262
from functools import partial
262263
from sys import version as python_version
263264
from threading import Thread
@@ -680,7 +681,7 @@ def extract_interfaces(self, host):
680681
else self.device_interfaces_lookup
681682
)
682683

683-
interfaces = list(interfaces_lookup[host["id"]].values())
684+
interfaces = deepcopy(list(interfaces_lookup[host["id"]].values()))
684685

685686
before_netbox_v29 = bool(self.ipaddresses_intf_lookup)
686687
# Attach IP Addresses to their interface

0 commit comments

Comments
 (0)