Correct the docs on custom module override behaviour#69699
Open
ggiesen wants to merge 2 commits into
Open
Conversation
A custom execution module only fully overrides a stock module when its filename matches the stock module's filename. A custom module with a different filename that returns an already-used virtual name from __virtual__ merely adds new functions under that name and leaves the stock functions in place. Correct the note in the execution module reference docs to describe this behaviour. Fixes saltstack#52521
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?
The execution module reference doc (doc/ref/modules/index.rst ~line 313) wrongly claimed that any module returning an already-used string from virtual overrides the stock module. The loader actually resolves by filename first, so a custom module with a different filename only adds new functions and never replaces the stock functions (confirmed intentional by the core team in the issue). Rewrote the note to state that a full override requires the custom module's filename to match the stock module's filename, otherwise only new functions are added. Doc-only fix; no unit test applicable and testPassed is set false because there is no runnable test, not because anything failed.
What issues does this PR fix or reference?
Fixes #52521
Previous Behavior
See #52521.
New Behavior
Correct the docs on custom module override behaviour. 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