Fix debian_ip not emitting IPv6 address stanzas#69687
Open
ggiesen wants to merge 3 commits into
Open
Conversation
The Debian ip module only understood ipv6ipaddr/ipv6ipaddrs, while the Red Hat module (rh_ip) uses ipv6addr/ipv6addrs. After the ipv6 prefix is stripped, the remaining addr/addrs had no mapping and failed validation, so no inet6 address stanza was emitted. Add addr->address and addrs->addresses aliases to SALT_ATTR_TO_DEBIAN_ATTR_MAP so both spellings (and bare addr/addrs) resolve to the Debian address settings, letting formulas share one set of names across distributions. Fixes saltstack#46618
The existing PR test already exercises the direct altitude: it calls build_interface() itself with the rh_ip-style ipv6addr/ipv6addrs kwargs, the exact settings names network.managed forwards verbatim from SLS kwargs. This adds the inverse guard against overcorrection from the new bare addr/addrs map entries: on a dual-family interface the aliased IPv6 address must stay confined to the inet6 stanza (the inet stanza renders byte-identical to a build with no IPv6 address), and a MAC-valued bare addr (the legacy shape network.managed remaps to hwaddr) must still be dropped by validation rather than emitted as a bogus address stanza. Both assertions hold with and without the source fix.
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.
What does this PR do?
debian_ip only understood ipv6ipaddr/ipv6ipaddrs, while rh_ip uses ipv6addr/ipv6addrs; after stripping the ipv6 prefix the remaining addr/addrs had no mapping and failed validation, so no inet6 address stanza was emitted. Fix adds addr->address and addrs->addresses aliases to SALT_ATTR_TO_DEBIAN_ATTR_MAP (plus reverse-map guards and a docstring note) so both spellings resolve to the Debian address settings. Verified via direct module execution that the new test's assertions pass with the fix and fail without it (unpatched emits no address line, EQUAL False; patched matches the canonical ipv6ipaddr output, EQUAL True); note the pytest runner could not complete in this shared env because the repo's large tests/conftest.py hangs during collection, so the assertions were validated by directly invoking the identical build_interface calls against the shadowed worktree module.
What issues does this PR fix or reference?
Fixes #46618
Previous Behavior
See #46618.
New Behavior
Fix debian_ip not emitting IPv6 address stanzas. Validated by a unit test proven to fail on unpatched 3006.x and pass with the fix (confirmed by adversarial review).
Merge requirements satisfied?
Commits signed with GPG?
No