Skip to content

Add nd_fabric_prepare_update module for ND 4.2 software staging#291

Open
allenrobel wants to merge 2 commits into
nd_fabric_update_groupfrom
nd_fabric_prepare_update
Open

Add nd_fabric_prepare_update module for ND 4.2 software staging#291
allenrobel wants to merge 2 commits into
nd_fabric_update_groupfrom
nd_fabric_prepare_update

Conversation

@allenrobel
Copy link
Copy Markdown
Collaborator

Stacked PR. Base branch is nd_fabric_update_group (per the stack); retarget to develop once the parent merges.

Related Issue(s)

N/A — new module.

Proposed Changes

  • New module nd_fabric_prepare_update — the Fabric Software Management "Prepare" step on Nexus Dashboard 4.2, i.e. the softwareUpdatePlan/actions/stage action: stages and validates the configured image on the switches of one or more update groups.
  • One-shot action module: pre-flight check rejects mixed-role update groups (ND will not prepare them), idempotent against already-staged groups, and with wait: true polls to completion.
  • FabricPrepareUpdateOrchestrator — drives the stage action and a poll loop that tolerates transient transport errors during the long wait.
  • New endpoint models EpFabricSoftwareUpdatePlanStage and EpFabricSoftwareUpdatePlanSummary; Pydantic models for the softwareUpdatePlan/summary response.
  • 33 unit tests (orchestrator + models) and an integration test target.

Test Notes

  • Unit: 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.
  • Sanity: ansible-test sanity --docker passes for all new/changed files.
  • Integration: 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

  • analyze
  • infra
  • manage
  • onemanage
  • other

Checklist

  • Latest commit is rebased from develop with merge conflicts resolved
  • New or updates to documentation has been made accordingly
  • Assigned the proper reviewers

🤖 Generated with Claude Code

allenrobel and others added 2 commits May 21, 2026 09:00
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>
@allenrobel allenrobel force-pushed the nd_fabric_update_group branch from 3c80477 to 67167cd Compare May 21, 2026 19:41
@allenrobel allenrobel force-pushed the nd_fabric_prepare_update branch from fc757df to 49a49b9 Compare May 21, 2026 19:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant