Skip to content

Restore salt.utils.network.nm_managed and rh_ip deferral to nm_ip - #70380

Merged
dwoz merged 3 commits into
saltstack:3008.xfrom
charzl:charzl/fix/70354-nm-managed-3008.x
Nov 13, 2026
Merged

dwoz merged 3 commits into
saltstack:3008.xfrom
charzl:charzl/fix/70354-nm-managed-3008.x

Conversation

@charzl

@charzl charzl commented Oct 9, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?

nm_ip.__virtual__ calls salt.utils.network.nm_managed(), which does not exist on 3008.x, so nm_ip fails to load on every run:

Exception raised when processing __virtual__ function for salt.loaded.int.module.nm_ip. Module will not be loaded: module 'salt.utils.network' has no attribute 'nm_managed'

nm_managed() and the matching rh_ip change were added together with nm_ip in 149f343 (3006.x) and are present on 3006.x and 3007.x. They did not make it into 3008.x: in the 3007.x -> 3008.x merge (#70132, merge commit 17c1f44) nm_ip.py came in, but salt/utils/network.py and salt/modules/rh_ip.py ended up identical to the previous 3008.x versions. 3008.x had not touched either file since the merge base, so a plain 3-way merge would have taken the 3007.x changes.

Restoring only the helper would silence the log, but rh_ip would still claim ip on EL10 (no ifdown), so both modules would compete for it. This PR restores both:

  • salt/utils/network.py: add nm_managed() (same as 3007.x)
  • salt/modules/rh_ip.py: restored from 3007.x, so rh_ip defers to nm_ip again
  • Tests: restore test_nm_ip.py; add tests for nm_managed and the rh_ip deferral
  • Changelog: 70354.fixed.md

Not touched: the same merge also dropped the UnicodeError handling in is_reachable_host (7d709d0) and its tests. That is a separate issue and not part of this PR.

What issues does this PR fix or reference?

Fixes #70354

Previous Behavior

nm_ip fails to load on 3008.x; rh_ip does not defer to it.

New Behavior

nm_ip loads on NetworkManager hosts without ifup/ifdown; rh_ip defers to it there.

Merge requirements satisfied?

  • Tests written/updated
  • Changelog entry added

@charzl
charzl requested a review from a team as a code owner October 9, 2026 00:04
@charzl charzl self-assigned this Oct 9, 2026
@charzl charzl added the test:full Run the full test suite label Oct 9, 2026
@charzl charzl added this to the Argon v3008.5 milestone Oct 9, 2026
twangboy
twangboy previously approved these changes Oct 9, 2026

@twangboy twangboy left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you validate that assessment?

Comment thread salt/utils/network.py Resolved
@charzl
charzl force-pushed the charzl/fix/70354-nm-managed-3008.x branch from 250024c to 6b293b5 Compare October 29, 2026 21:25
@twangboy twangboy modified the milestones: Argon v3008.5, Argon v3008.7 Oct 30, 2026
nm_ip.__virtual__ calls salt.utils.network.nm_managed(), which is missing
on 3008.x, so nm_ip fails to load with "module 'salt.utils.network' has no
attribute 'nm_managed'" on every run. The 3007.x -> 3008.x merge brought in
nm_ip.py but reverted the network.py helper and the rh_ip.py change that
makes rh_ip defer to nm_ip.

Restore the helper and rh_ip.py from 3007.x, and add the nm_ip tests plus
tests for nm_managed and the rh_ip deferral.

Fixes saltstack#70354
Use 'or' so a host with only one of ifup/ifdown stays with rh_ip, as the
docstring says. Add tests for the ifup-only and ifdown-only cases.

This branch was previously deployed

1 inactive deployment
ci — a45e1bcb Deployed Nov 12, 2026 by charzl via Build Onedir Packages / DEB (arm64) #28846
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Argon v3008.0 test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants