Add nd_fabric_prepare_update module for ND 4.2 software staging#291
Open
allenrobel wants to merge 2 commits into
Open
Add nd_fabric_prepare_update module for ND 4.2 software staging#291allenrobel wants to merge 2 commits into
allenrobel wants to merge 2 commits into
Conversation
Implements the Fabric Software Management "Prepare" step on Nexus Dashboard 4.2 - the softwareUpdatePlan/actions/stage action - which stages and validates the configured image on the switches of one or more update groups. - New module nd_fabric_prepare_update: a one-shot action module that pre-flight checks for mixed-role update groups, is idempotent against already-staged groups, and (with wait) polls to completion. - FabricPrepareUpdateOrchestrator: drives the stage action and a poll loop that tolerates transient transport errors during the long wait. - EpFabricSoftwareUpdatePlanStage and EpFabricSoftwareUpdatePlanSummary endpoint models; softwareUpdatePlan/summary response models. - 33 unit tests (orchestrator + models) and an integration test target. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
preflight_role_check and status_snapshot each fetched softwareUpdatePlan/summary independently, so a prepare run made two identical GETs back-to-back at startup. Both now accept an optional pre-fetched summary; _run_prepare fetches it once and passes it to both. Startup now costs one summary GET instead of two (check mode included), and the role check and `before` snapshot observe the same point-in-time summary. Adds test_fabric_prepare_update_00220 asserting a single GET across the three startup calls. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
3c80477 to
67167cd
Compare
fc757df to
49a49b9
Compare
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.
Related Issue(s)
N/A — new module.
Proposed Changes
nd_fabric_prepare_update— the Fabric Software Management "Prepare" step on Nexus Dashboard 4.2, i.e. thesoftwareUpdatePlan/actions/stageaction: stages and validates the configured image on the switches of one or more update groups.wait: truepolls to completion.FabricPrepareUpdateOrchestrator— drives the stage action and a poll loop that tolerates transient transport errors during the long wait.EpFabricSoftwareUpdatePlanStageandEpFabricSoftwareUpdatePlanSummary; Pydantic models for thesoftwareUpdatePlan/summaryresponse.Test Notes
python -m pytest tests/unit/module_utils/models/test_fabric_prepare_update.py tests/unit/module_utils/orchestrators/test_fabric_prepare_update.py— 33 pass.ansible-test sanity --dockerpasses for all new/changed files.ansible-test integration nd_fabric_prepare_update— green against a live ND 4.2.1 lab (fabric SITE1), covering mixed-role pre-flight rejection, check mode, a real stage + wait, and idempotency.Cisco Nexus Dashboard Version
4.2.1
Related ND API Resource Category
Checklist
🤖 Generated with Claude Code