![]() * test_linux_sysctl: Reduce indentation level Reduce indentation level to improve readability. Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com> * test_linux_sysctl: Fix test_persist_no_conf_failure `test_persist_no_conf_failure` has different behaviour depending on the operating system it is executed on. Mock all system calls and let it fail in the first try to write the sysctl configuration file. Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com> * linux_sysctl: Pass parameters as list to cmd.run Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com> * linux_sysctl.show: Fix parsing of sysctl.conf files The lines in sysctl.conf files can contain leading and trailing spaces. The equal sign (that separates the key and value) might have zero to multiple white spaces. Valid example: ``` kernel.core_pattern = |/usr/share/kdump-tools/dump-core %p %s %t %e # Stop low-level messages on console = less logging kernel.printk = 3 4 1 3 net.ipv4.ip_forward=1 ``` `sysctl.show` currently has two issues: * all values contain a trailing newline * Comments with leading spaces and equal sign in them are not skipped Address both issues and simplify the code and cover them with unit tests. Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com> * linux_sysctl.present: Fix replacing spaces by tabs `salt/modules/linux_sysctl.py` tries to be smart in `persist()` and replaces spaces by tabs, which will be correct for keys like `net.ipv4.tcp_rmem` but not for `kernel.core_pattern`. So only sanitize the values for comparison, but not for persisting them in the configuration file. Bug: https://github.com/saltstack/salt/issues/40054 Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com> * linux_sysctl: Drop unreachable code The check `if "=" not in line` already ensures that the split by `=` will return two elements. Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com> * fixing failing tests * need to mock which in test_assign_success Signed-off-by: Benjamin Drung <benjamin.drung@ionos.com> Co-authored-by: Benjamin Drung <benjamin.drung@ionos.com> Co-authored-by: Gareth J. Greenaway <gareth@saltstack.com> |
||
---|---|---|
.github | ||
.pre-commit-hooks | ||
changelog | ||
cicd | ||
conf | ||
doc | ||
pkg | ||
requirements | ||
rfcs | ||
salt | ||
scripts | ||
tasks | ||
templates | ||
tests | ||
.bandit | ||
.codeclimate.yml | ||
.codecov.yml | ||
.coveragerc | ||
.editorconfig | ||
.git-blame-ignore-revs | ||
.gitattributes | ||
.gitignore | ||
.gitlab-ci.yml | ||
.mention-bot | ||
.pre-commit-config.yaml | ||
.pylintrc | ||
.rstcheck.cfg | ||
AUTHORS | ||
CHANGELOG.md | ||
CODE_OF_CONDUCT.md | ||
CONTRIBUTING.rst | ||
DEPENDENCIES.md | ||
Gemfile | ||
kitchen.yml | ||
LICENSE | ||
MANIFEST.in | ||
noxfile.py | ||
pyproject.toml | ||
pytest.ini | ||
README.rst | ||
run.py | ||
SECURITY.md | ||
setup.cfg | ||
setup.py | ||
SUPPORT.rst |

- Latest Salt Documentation
- Open an issue (bug report, feature request, etc.)
Salt is the world’s fastest, most intelligent and scalable automation engine.
About Salt
Built on python, Salt uses simple and human-readable YAML combined with event-driven automation to deploy and configure complex IT systems. In addition to leveling-up vRealize Automation SaltStack Config, Salt can be found under the hood of products from Juniper, Cisco, Cloudflare, Nutanix, SUSE, and Tieto, to name a few.
About SaltStack
SaltStack was acquired by VMware in 2020. Salt Project remains an open source ecosystem that VMware supports and contributes to.
Download Salt
Salt is tested and packaged to run on CentOS, Debian, RHEL, Ubuntu, MacOS, Windows, and more. Download Salt and get started now.
Salt Project Documentation
Installation instructions, getting started guides, in-depth API documentation, and contributing to Salt.
Security Advisories
Keep an eye on the Salt Project Security Announcements landing page. Salt Project recommends subscribing to the Salt Project Security RSS feed to receive notification when new information is available regarding security announcements.
Other channels to receive security announcements include the Salt Community mailing list and the Salt Project Community Slack.
Responsibly Reporting Security Vulnerabilities
When reporting security vulnerabilities for Salt or other SaltStack projects, refer to the SECURITY.md file found in this repository.
Engage the Salt Project and The Community
Please be sure to review our Code of Conduct. Also, check out some of our community resources including:
- Salt Project Community Wiki
- Salt Project Community Slack
- Salt Project: IRC on LiberaChat
- Salt Project YouTube channel
- Salt Project Twitch channel
There are lots of ways to get involved in our community. Every month, there are around a dozen opportunities to meet with other contributors and the Salt Core team and collaborate in real time. The best way to keep track is by subscribing to the Salt Project Community Events Calendar on the main https://saltproject.io website.
If you have additional questions, email us at saltproject@vmware.com or reach out directly to the Community Manager, Janae Andrus via Slack. We’d be glad to have you join our community!
License
Salt is licensed under the Apache 2.0 license. Please see the LICENSE file for the full text of the Apache license, followed by a full summary of the licensing used by external modules.
A complete list of attributions and dependencies can be found here: salt/DEPENDENCIES.md