Skip to content

nd_interface_*: adopt shared config_actions_spec() and apply_config_actions() bridge - #524

Open
allenrobel wants to merge 1 commit into
developfrom
interface-config-actions-spec
Open

nd_interface_*: adopt shared config_actions_spec() and apply_config_actions() bridge#524
allenrobel wants to merge 1 commit into
developfrom
interface-config-actions-spec

Conversation

@allenrobel

Copy link
Copy Markdown
Collaborator

Related Issue(s)

Closes #523

Follow-up to #520; interface-family slice of the "centralize first, align semantics later" step from the #368 analysis (M1/M2).

Proposed Changes

  • Replace the eight hand-written inline config_actions={...} argspec blocks (ethernet_trunk_host, port_channel_access, port_channel_trunk_host, subinterface_managed, subinterface_unmanaged, svi, vpc_access, vpc_trunk_host) with argument_spec.update(config_actions_spec(include=("deploy",))), matching loopback and ethernet_access. All ten nd_interface_* modules now build the option from the shared fragment in nd_argument_specs.py.
  • Add NDBaseInterfaceOrchestrator.apply_config_actions(params) -> bool as the single bridge from module params to the orchestrator's deploy flag; all ten main() functions call it instead of re-implementing the three-line parse. Deployment stays opt-in (default False).
  • No behavior change. Fabric / switches / vPC pair config_actions are deliberately untouched until the Module Support for config_actions + resource level deploy #368 contract decisions are recorded.

Test Notes

  • tests/unit/modules/test_nd_interface_deploy_default.py now covers all ten modules and adds test_nd_interface_deploy_default_00010, asserting each module's runtime config_actions spec equals config_actions_spec(include=("deploy",))["config_actions"] (guards against inline drift).
  • tests/unit/module_utils/orchestrators/test_base_interface.py adds test_base_interface_00970/00980 for apply_config_actions() (explicit true/false; absent / None / {}False, actively resetting a prior True).
  • Full unit suite: 4088 passed (ndpytest tests/unit/).
  • black, isort, pylint clean on all changed files; validate-modules sanity passes on the ten modules via ndtest.
  • mypy on base_interface.py reports only the three pre-existing ModelType attr-defined errors (lines 256/302), unrelated to this change.

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

https://claude.ai/code/session_01F7fNh2q6RyHbb37T67hkN6

@allenrobel allenrobel self-assigned this Aug 25, 2026
@allenrobel allenrobel added 2.0.0 Release 2.0.0 ready for review Submitter is requesting a PR review labels Aug 25, 2026
…ctions() bridge

Replace the eight hand-written inline `config_actions={...}` argspec blocks with
`config_actions_spec(include=("deploy",))`, so all ten nd_interface_* modules build the
option from the shared fragment in nd_argument_specs.py.

Add `NDBaseInterfaceOrchestrator.apply_config_actions(params)` as the single bridge from
module params to the orchestrator's `deploy` flag, and use it from all ten modules in place
of the duplicated three-line parse. Deployment stays opt-in (default False).

No behavior change. Extends test_nd_interface_deploy_default.py to all ten modules and
asserts the runtime `config_actions` spec equals the shared fragment; adds
apply_config_actions() tests to test_base_interface.py.

Closes #523

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01F7fNh2q6RyHbb37T67hkN6
@allenrobel
allenrobel force-pushed the interface-config-actions-spec branch from bdf7a19 to a284f23 Compare August 27, 2026 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

2.0.0 Release 2.0.0 ready for review Submitter is requesting a PR review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nd_interface_*: adopt shared config_actions_spec() and a single deploy bridge

1 participant