Skip to content

Surface every __virtual__ False reason on virtualname collisions (#68625) - #69359

Merged
dwoz merged 1 commit into
saltstack:3006.xfrom
dwoz:fix/issue-68625
Jun 10, 2026
Merged

dwoz merged 1 commit into
saltstack:3006.xfrom
dwoz:fix/issue-68625

Conversation

@dwoz

@dwoz dwoz commented Jun 7, 2026

Copy link
Copy Markdown
Contributor

What does this PR do?

When two execution modules declare the same __virtualname__ and each __virtual__() returns False, the loader now records every failure reason under that virtualname instead of only the first one seen.

What issues does this PR fix or reference?

Fixes #68625

Previous Behavior

A salt-ssh user trying to call x509.expires on a target without cryptography installed only saw:

'x509' __virtual__ returned False: Superseded, using x509_v2

The actual blocker (x509_v2's Could not load cryptography) was masked because the loader stored only the first failure reason recorded under the shared x509 virtualname.

New Behavior

The user now sees both reasons:

'x509' __virtual__ returned False: Superseded, using x509_v2; Could not load cryptography

Internally:

  • _process_virtual() now reports False results under the module's explicit __virtualname__ when one is set, so the caller can detect collisions.
  • _load_module() merges new failure reasons with the existing one under the shared virtualname (joined by ; ) instead of dropping all but the first.

Merge requirements satisfied?

  • Docs
  • Changelog
  • Tests written/updated

Commits signed with GPG?

Yes

When two modules declare the same __virtualname__ and both __virtual__()
return False (e.g. salt.modules.x509 and salt.modules.x509_v2, both
claiming the virtualname 'x509'), the loader recorded only the first
failure reason under that virtualname and dropped the rest. Users who
ran into the collision saw a misleading 'Superseded, using x509_v2'
message instead of the actual blocker (e.g. salt-ssh's thin archive
lacking the cryptography library).

Update _process_virtual() to report False results under the explicit
__virtualname__ when one is set, and update _load_module() to merge
failure reasons under the shared virtualname instead of keeping only
the first.

Fixes saltstack#68625
@dwoz
dwoz merged commit fd091ce into saltstack:3006.x Jun 10, 2026
817 of 834 checks passed
@dwoz
dwoz deleted the fix/issue-68625 branch November 13, 2026 08:29

This branch was previously deployed

1 inactive deployment
ci — b45b7211 Deployed Jun 7, 2026 by dwoz via Build Onedir Packages / Windows (amd64) #23536
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

test:full Run the full test suite

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants