The fix is to normalize source-prefix-list and destination-prefix-lis… - #845
Merged
Conversation
…t in acl module. `
| if term["from"].get("protocol"): | ||
| ace["protocol"] = term["from"]["protocol"] | ||
| if term["from"].get("payload-protocol"): | ||
| ace["protocol"] = term["from"]["payload-protocol"] |
Collaborator
There was a problem hiding this comment.
if term["from"].get("protocol"):
ace["protocol"] = term["from"]["protocol"]
if term["from"].get("payload-protocol"):
ace["protocol"] = term["from"]["payload-protocol"] - payload-protocol silently overwrites protocol , check if this needs a separate key
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.
Description
Fixes parsing of ACL prefix list fields in parsed state by normalizing single and multiple source-prefix-list and destination-prefix-list values into the schema-expected list of objects format.
Closes #
Collection Namespace
Collection namespace: juniper.device (source fix), junipernetworks.junos (tests)
Collection version (bumped to): Not bumped in this change set
Module(s) / plugin(s) changed:
juniper.device facts parser for ACLs
junipernetworks.junos unit test for junos_acls
junipernetworks.junos integration parsed test fixture/assertions for junos_acls
Type of Change
Fix Details
Root Cause
In parsed workflow for ACL facts, XML parsing could return prefix-list fields as a single scalar/dict for one entry, while the argspec requires list of dict objects. Validation then failed with dictionary requested, could not parse JSON or key=value.
Solution
Normalized source-prefix-list and destination-prefix-list in ACL facts parser into list form and object form expected by argspec.
Added normalization for single and multi-value source-prefix-list
Added normalization for single and multi-value destination-prefix-list
Added unit tests covering both single-entry normalization and multi-entry preservation
Updated integration parsed fixture/assertions to validate prefix-list behavior end-to-end
Versions Tested
Sanity Test Results
Sanity test output
Unit Test Results
tests/unit/Unit test output
Integration Test Results
Integration test output
Checklist
Code Quality
ansible-lintpasses with no new errorsflake8/ruffreports no new errors (for Python files)flake8 plugins/ # or ruff check plugins/Documentation
CHANGELOG.rst/changelogs/fragments/entry addedgalaxy.ymlversion bumped if releasingGeneral
requirements.txtupdated if new Python packages are requiredAdditional Notes