-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Component
No response
Infrahub SDK version
1.1.6
Current Behavior
If the parent and all the components of the relationship are being deleted due to the difference in the generator, it fails with: ['NetworkPhysicalInterfaceL3Delete'] Unable to find the node 1821cc90-7fb1-f8b3-3b21-c51f9599f512 / NetworkPhysicalInterfaceL3 in the database.
This example is all interfaces (component) to a device (parent) are being deleted as well as the parent object.
Expected Behavior
It would just delete the parent node rather than all the component objects tied to the node to prevent it attempting to delete a component when the parent has been deleted and the deletion is cascading down.
Steps to Reproduce
- Spin up infrahub
- Load
baseandextensions/location_minimalfrom https://github.com/opsmill/schema-library - Create a generator that will build a site, 2 devices, and 24 interfaces for each device (ranges would work to keep generator simple)
- Run the generator and let it create the devices and interfaces
- Modify the generator to only generate one of those devices
- Execute generator and it should show an error that it fails to delete one of the interfaces due to it no longer existing
Additional Information
While researching this further, I believe this code may need to account for parent/component relationships when processing previous children.
https://github.com/opsmill/infrahub-sdk-python/blob/stable/infrahub_sdk/query_groups.py#L102-L111