[codex] Include WAN edge inventory in device lookup#197
Closed
sashiv20 wants to merge 5 commits into
Closed
Conversation
nikhilkp93
approved these changes
May 27, 2026
Collaborator
Collaborator
Author
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.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->524 passed, 10 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.pygit diff --checkNote: repo pre-commit was attempted, but local hook tooling is stale on this machine:
pyclnfails under Python 3.12 withast.Str, and the mypy hook expectspoetryto be installed.