Repository navigation
Follow up to PR #38527 - #38585
Follow up to PR #38527#38585
Conversation
Conflicts: - salt/config/__init__.py
| # Let's set the pidfile and log_file values in opts to api settings | ||
| opts.update({ | ||
| 'pidfile': opts.get('api_pidfile', DEFAULT_API_OPTS['api_pidfile']), | ||
| 'log_file': opts.get('api_logfile', DEFAULT_API_OPTS['api_logfile']), |
There was a problem hiding this comment.
I looked through the history for this file and I do not understand the purpose of setting pidfile and log_file to the corresponding api_* values at all. Shot in the dark: I wonder if the daemon that manages netapi modules is expecting those values and should be switched to look for the api_* variants. Edit: Or maybe the way we're doing the settings mixins means these value names are set in stone?
That said, in order to correctly work with a non-default root_dir setting both those values would also need to be added to the prepend_root_dir call below.
I think this PR looks good with the prepend_root_dir change in place.
There was a problem hiding this comment.
@whiteinge Hm. Yeah I am assuming there was something going on later down the line that is using those pidfile and log_file settings somewhere in salt-api, especially since there was a change in this code recently in #37272, which removed the log_file setting and caused issue #38479. I didn't want to cause that bug again since that was fixed recently on this branch.
Just to make sure I am following you correctly, you're saying that the prepend_root_dir option also needs the pidfile and log_file settings? Something like this?
prepend_root_dir(opts, [
'api_pidfile',
'api_logfile',
'log_file',
'pidfile'
])
Or am I misunderstanding what you said?
There was a problem hiding this comment.
No, you're exactly right. That addition makes everything work correctly for me in a quick local smoke test.
There was a problem hiding this comment.
Perfect. I have made that change locally, but I am also writing some quick unit tests for this change. I'll push everything up when those are finished.
This will help prevent regressions in this area as discussed in PR saltstack#38527.
|
OK @cachedout and @whiteinge this should be good to go now, depending on the test run. |
|
Hrm. I am not sure how that reference to the |
Without this copy, the settings in DEFAULT_API_OPTS was getting overridden by the new settings in the unit test. Let's copy those default settings, and then restore them at the end of the test. These tests have also been marked as destructive.
|
Found where those were getting set (in the salt.config.api_config function call itself). I have adjusted the tests to make a copy of those defaults before the test runs and then also restored those default settings at the end of the test run. This should be ready now, pending the latest test run. |
|
Go Go Jenkins! |
1 similar comment
|
Go Go Jenkins! |
What does this PR do?
This PR back-ports the changes made by @rbjorklin in #38527 to the 2016.3 branch and also adds back in the
log_fileandpidfilevalue settings.This ensures that if
rest_timeoutvalues are set in the master config file, the value defined in theDEFAULT_API_OPTSwill not overwrite the value defined in the master config file. (This will also be the case for any additions API default opts that get added toconfig/__init__.pydown the line.)This change also ensures that that the
log_fileandpidfilevalues are overwritten by the values specified byapi_logfileandapi_pidfile, respectively, either explicitly by the user in the master config file or by the values defined byDEFAULT_API_OPTS.I would like to write a test case for this as well, but I wanted to get some feedback on this approach first.
This approach should be covering both the
rest_timeoutsetting bug as well as thelog_filebugs that have been filed recently against this area of the code. The relevant PRs and bug reports are linked below. A more detailed discussion of this change is in #38527.I would love it if @whiteinge could review this change as well.
What issues does this PR fix or reference?
PRs:
Issues: