nd_interface_port_channel_trunk_host module#270
Open
allenrobel wants to merge 10 commits intond_interface_port_channel_accessfrom
Open
nd_interface_port_channel_trunk_host module#270allenrobel wants to merge 10 commits intond_interface_port_channel_accessfrom
allenrobel wants to merge 10 commits intond_interface_port_channel_accessfrom
Conversation
39e151c to
4e69ab6
Compare
835edb8 to
6e2ccb3
Compare
4e69ab6 to
b861768
Compare
akinross
reviewed
May 5, 2026
6e2ccb3 to
bdd7390
Compare
b861768 to
55fb7a3
Compare
bdd7390 to
532a0ff
Compare
55fb7a3 to
1770181
Compare
532a0ff to
b741c2c
Compare
1770181 to
9eacb19
Compare
Mirrors nd_interface_port_channel_access structure for the trunkPoHost policy type. 42-field policy model covers the full ND OpenAPI intPortChannelTrunkHostTemplate superset, including bandwidth, linkType, negotiateAuto, vlan_mapping/dot1q-tunnel, and storm-control float fields. policyType is hardcoded to "trunkPoHost" and not exposed in the argspec. Integration tests cover merged/replaced/overridden/deleted, member uniqueness ordering, and a non-9000v vlan_mapping block. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Covers PortChannelTrunkHostInterfaceModel and PortChannelTrunkHostInterfaceOrchestrator: field defaults, snake_case/camelCase construction, allowed_vlans regex (with int->str coercion for ND's single-id-as-int responses), native_vlan/bandwidth/inherit_bandwidth range checks, AsciiDescription, storm-control float-from-string coercion, vlan_mapping entries, composite identifier round-trips, hardcoded policyType, query_all filtering to trunkPoHost only. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Add module docstring, scope a wrong-import-position disable to the post-DOCUMENTATION import block, and replace dict() call with a literal. Pylint score now 10.00/10. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Addressed #270 (comment)
Replace shape-only regex with Annotated types (AllowedVlans, CustomerVlanIdList) backed by a shared per-token validator that enforces VLAN ids in 1..4094 and rejects reversed ranges. Addresses review feedback on lines 57-58 of port_channel_trunk_host_interface.py and closes the same gap on customer_vlan_id. Mark both types with a TODO to consolidate into models/types.py once sibling branches merge. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
VlanId (1..4094) recurs as Field(ge=1, le=4094) on multiple fields across the interface family. Defer the cleanup to the same post-merge PR that introduces AllowedVlans / CustomerVlanIdList in models/types.py. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Address review comment requesting that the valid VLAN id range (1-4094) be stated in the module docstring. The model validators already enforce this range; this only updates the user-facing documentation for parity with native_vlan and similar fields. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Address review comment asking why only merged and deleted examples were shown. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
Replace verbatim-repeated module argument blocks (check / normal / idempotent runs of the same call) with YAML anchors. Reduces ~140 lines of duplication across deleted, merged, replaced, overridden, and vlan_mapping task files, and removes a class of typo where one of the duplicated blocks could drift from its siblings. Anchors are defined at first use within each section to keep them local to the reader.
Move the top-of-file SETUP block from merged.yaml (delete port-channel501/502/503) into a dedicated tasks/setup.yaml and call it from main.yaml before the state-test blocks. Makes the orchestration explicit and keeps merged.yaml focused on its state. Intra-test setup that's coupled to specific tests stays inline: - Reset-to-baseline before the membership tests in merged.yaml - port-channel504 cleanup after the no-deploy test in merged.yaml - vlan_mapping.yaml's local SETUP/CLEANUP for port-channel501
a6b89bd to
bba871b
Compare
22ea587 to
6009d17
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
Proposed Changes
nd_interface_port_channel_trunk_hostAnsible module managingtrunkPoHostport-channel interfaces on Cisco Nexus Dashboard 4.2.nd_interface_port_channel_accessstructure: composite identifier (switch_ip,interface_name),policyTypehardcoded to"trunkPoHost"and not exposed in argspec, full ND OpenAPIintPortChannelTrunkHostTemplatefield set (42 policy fields includingbandwidth,link_type,negotiate_auto,vlan_mappingwith selective dot1q-tunnel, storm-control float fields).TrunkPoHostPolicyTypeEnum,LinkTypeEnuminplugins/module_utils/models/interfaces/enums.py.PortChannelBaseOrchestrator; managed policy types filter to{"trunkPoHost"}only.state: overriddendeletes viainterfaceActions/remove(mirrors access PC);state: querydeferred consistent with current parity stance.allowed_vlansregex withint -> strcoercion for ND's single-id-as-int responses), AsciiDescription, storm-control float-from-string coercion, vlan_mapping entries, composite identifier round-trips, andquery_allfiltering.vlan_mappingblock guarded bynd_test_platform.Test Notes
pytest tests/unit/module_utils/ -k port_channel_trunk_host -v(156 passed). Full suite (pytest tests/unit/): 705 passed, no regressions.blackandpylintclean (matching access PC scoring).vlan_mappingblock skipped on 9000v as expected.policyType: "trunkPoHost"and accepts the model's payload shape (verified with POST/GET/PUT/DELETE round-trip during development).allowedVlansas a JSON int rather than string; the model coercesint -> strin amode='before'validator and a unit test locks the behavior.Cisco Nexus Dashboard Version
4.2
Related ND API Resource Category
Checklist
Stacking
This PR is stacked on top of #269 (
nd_interface_port_channel_access). Base branch isnd_interface_port_channel_access; merge after #269 lands.🤖 Generated with Claude Code