Include WAN edge inventory in device lookup#199
Open
sashiv20 wants to merge 1 commit into
Open
Conversation
nikhilkp93
approved these changes
May 28, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix
DevicesAPI.get()so callers can resolve WAN edge devices that are present in configuration inventory but absent from the monitored/dataservice/deviceresponse on newer vManage trains.This is the replacement for #197 with the CI-only commits removed, per the maintainer comment on #197 after #198 merged the CI fixes into
main.Root Cause
In the failing vTest run,
mtt_aaa.test_create_attach_device_templatelooked upvm81withDevicesAPI(provider_session).get().filter(hostname=mt_edge.name).single_or_default(). On vManage27.1.991-1,/dataservice/devicereturned only controllers before template attach, so the lookup returnedNone.TemplatesAPI.attach()then dereferenceddevice.uuid, producing a rawAttributeError.Changes
/dataservice/deviceand/dataservice/device/system/info.vedges).DeviceDetailsResponsealiases for newer/older inventory payload field names.TemplatesAPI.attach()is called with a missing template or device.Validation
uv run pytest catalystwan/tests/test_devices_api.py catalystwan/tests/test_templates.py->55 passed, 1 skippeduv run flake8 catalystwan/api/basic_api.py catalystwan/api/template_api.py catalystwan/endpoints/configuration_device_inventory.py catalystwan/tests/test_devices_api.py catalystwan/tests/test_templates.pyuv run mypy --show-error-codes --show-error-context --pretty --install-types --non-interactive catalystwan --cache-dir=.mypy_cache/ --disable-error-code overridegit diff --check origin/main...HEAD