mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-18 05:28: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
|
# Assign it to the module
|
||||||
existing_item.module = self
|
existing_item.module = self
|
||||||
update_instances.append(existing_item)
|
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
|
continue
|
||||||
|
|
||||||
# Only create new components if replication is enabled
|
# Only create new components if replication is enabled
|
||||||
|
Loading…
Reference in New Issue
Block a user