Repository navigation
Surface every __virtual__ False reason on virtualname collisions (#68625) - #69359
Merged
Merged
Conversation
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
twangboy
approved these changes
Jun 10, 2026
This branch was previously deployed
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?
When two execution modules declare the same
__virtualname__and each__virtual__()returnsFalse, 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-sshuser trying to callx509.expireson a target withoutcryptographyinstalled only saw:The actual blocker (
x509_v2'sCould not load cryptography) was masked because the loader stored only the first failure reason recorded under the sharedx509virtualname.New Behavior
The user now sees both reasons:
Internally:
_process_virtual()now reportsFalseresults 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?
Commits signed with GPG?
Yes