Fixes#8343 since `__sls__` is now available in `__state__` and not on `kwargs`.
Closes#8709 since it's not the right approach.
Fixes#8710 and closes#8711 since I've cherry-picked the fix for #8710 in from #8711.
* Updated `salt.modules.file.makedirs` to properly work. Any path passed to this function should be a directory, ie, if `/tmp/foo/bar` is passed, `/tmp/foo/bar` should be a directory, not `/tmp/foo`.
* Since `salt.modules.file.makedirs` was updated, `salt.states.file.append` needed to be updated to pass the proper directory to create.
* Minor formatting change
* When `re.search`'ing, do a `re.MULTILINE` search. Not all matches happen on first line, specially using the `BufferedReader`.
* PEP-8 fixes.
* Removed `rowname` from `salt.utils.mysql_to_dict()` since it was not being used.
Rewrite file.recurse state module to leverage existing file.managed and file.directory
modules to do the heavy lifting. This removes code duplication and will make
templates available for file.recurse.
These improvements will be visible to the end-user:
- All files in directory can now be templatized
- destination directory is no longer created in test mode
- When clean mode is enabled, the module is capable of replacing
existing files with directories and vice versa
On the parsers cleanup branch, I though about making the available options as equal as possible. Since the log_file setting for the master and the minion could be separately set, I made the logfile option for the key also log_file. Yet, since there's no key specific config file, it shares master, one could only specify the log_file settings from the cli, it could not be hardcoded on the config file, unless, we made a separate config file just for key.
So, in order to reduce required changes, and keep it all as backwards compatible as possible, the key log file options is now, once again, `--key-logfile` which will allow us to hardcode it in the masters config file as `key_logfile`.
This will also, hopefully make travis behave better too.
When using `--no-clean` while running tests, some files/dirs still need to be removed, if not, test will fail. This commit tries to addresses those issues.
Defined "integration.run_tests()" function which can be used to execute
a particular integration test case. Existing bolerplate code in modules
and states tests is replaced with following lines:
if __name__ == '__main__':
from integration import run_tests
run_tests(TestCaseName)
Typical usecase could look like this:
python integration/modules/pip.py --no-clean -vv
Function "file.contains_regex" used to search values from the beginning
of the line and thus couldn't find pattern "hello world" in a "#hello
world" string.