mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-17 21:18:16 -06:00
Adopt child interfaces when adopting components
This commit is contained in:
parent
f415d81049
commit
1c0bd6f788
@ -1107,6 +1107,14 @@ class Module(NetBoxModel, ConfigContextModel):
|
||||
# Assign it to the module
|
||||
existing_item.module = self
|
||||
update_instances.append(existing_item)
|
||||
|
||||
# Adopt child interfaces
|
||||
if component_model is Interface:
|
||||
for child_interface in existing_item.child_interfaces.filter(module__isnull=True):
|
||||
child_interface.module = self
|
||||
update_instances.append(child_interface)
|
||||
|
||||
# If we adopted, skip creation
|
||||
continue
|
||||
|
||||
# Only create new components if replication is enabled
|
||||
|
Loading…
Reference in New Issue
Block a user