get_devices_in_container returns devices defined in wrong container
Closed this issue · 1 comments
cheynearista commented
We shouldn't be using getInventory for searching for devices in a container. This will return invalid results. Example:
- Define two containers: 'Leaf' and 'Test'
- Create several devices called 'Leaf1', 'Leaf2', etc...
- Move devices into container 'Test' leaving Container 'Leaf' empty
- Perform get_devices_in_container('Leaf')
- This will return any device that has 'Leaf' in the name
cheynearista commented
One way to fix is to get the Container info from name.
Using the above container info/key, filter out devices that have the parent container key equal.