File tree Expand file tree Collapse file tree 2 files changed +12
-2
lines changed
tests/integration/targets/inventory/files Expand file tree Collapse file tree 2 files changed +12
-2
lines changed Original file line number Diff line number Diff line change @@ -831,10 +831,13 @@ def refresh_ipaddresses(self):
831831 interface_id = ipaddress ["interface" ]["id" ]
832832 ip_id = ipaddress ["id" ]
833833
834- self .ipaddresses_lookup [interface_id ][ip_id ] = ipaddress
834+ # We need to copy the ipaddress entry to preserve the original in case caching is used.
835+ ipaddress_copy = ipaddress .copy ()
836+
837+ self .ipaddresses_lookup [interface_id ][ip_id ] = ipaddress_copy
835838
836839 # Remove "interface" attribute, as that's redundant when ipaddress is added to an interface
837- del ipaddress ["interface" ]
840+ del ipaddress_copy ["interface" ]
838841
839842 @property
840843 def lookup_processes (self ):
Original file line number Diff line number Diff line change @@ -3,6 +3,13 @@ api_endpoint: "http://localhost:32768"
33token : " 0123456789abcdef0123456789abcdef01234567"
44validate_certs : False
55
6+ # Use cache on this test to make sure interfaces is tested via the cache
7+ cache : True
8+ cache_timeout : 3600
9+ cache_plugin : jsonfile
10+ cache_connection : /tmp/inventory_netbox
11+
12+
613config_context : True
714flatten_config_context : True
815flatten_custom_fields : True
You can’t perform that action at this time.
0 commit comments