-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_syspaths.py variables defaulted unless explicitly changed #52230
Comments
An additional motive for not having to declare attributes that would just be I don't think we should do your second proposed change though. I don't think an existing |
ping @saltstack/team-core can i get your opinions here? |
On the face of it I agree with @nixjdm - seems like I don't know if there were other more original ideas/reasons, though. One counterpoint that I can think of - allowing missing values to pass silently could lead to problems with typos, or people missing out when new things are added that they may want to provide. An approach that might be ideal is that if there are missing values that we provide a warning on startup suggesting that we'll set the value to |
@waynew, my secondary addition had also been thinking about users missing new variables, but your suggestion of a warning message would be a better way. So if we are going to put a warning message then some thoughts for that:
Also keep in mind, we have agreed in another issue to create a _syspaths.py docs page to explain those variables, so that will be another avenue for users to see new variables being added as salt develops. |
@alan-cugler Yeah, I think the warning log level would be ideal - because if we're operating under the assumption that if you're missing a value it's probably a mistake on the users part, then they should get informed about it. Especially if all it takes to silence the warning is just add I do like a typo warning - especially if there's no "normal" reason for them to have other values in that file. I'm particularly OK if we only check I like both the warning + the docs because I know not all users are reading docs or keeping up with release notes, and occasionally we miss some doc updates 😛 But perhaps the warning should link to the new docs page ;) |
Cool
|
@alan-cugler done ✨ |
Made a pull request. |
Intent
This is a discussion issue of a possible PR to the "develop" branch of salt.
Description of Issue
Currently the
_syspaths.py
file has a set default of "None" for all variables listed.You can set these variables to custom directories for individual parts of the salt infrastructure.
However, if you don't state all of the variables in this file the import in syspaths.py will result in an error like in #52228.
Proposed Change
The
import
line in thesyspaths.py
file should be modified to assume all non-mentioned variables default to "None" implicitly. This way the user can state only variables they are concerned with and ignore the rest whether they are there or not in the_syspaths.py
fileA secondary addition would be to have
syspaths.py
add in the[missing variable] = None
at the bottom of_syspaths.py
for all variables missing from the import.Related Issues
The text was updated successfully, but these errors were encountered: