When using a custom config path for sysctl states, it would fail with an IOError
as it was looking for the defaults which also may not exist as shown below:
----------
ID: net.ipv4.tcp_keepalive_intvl
Function: sysctl.present
Result: False
Comment: An exception occurred in this state: Traceback (most recent call last):
File "/usr/lib/python2.7/site-packages/salt/state.py", line 1533, in call
**cdata['kwargs'])
File "/usr/lib/python2.7/site-packages/salt/states/sysctl.py", line 56, in present
configured = __salt__['sysctl.show'](config_file=True)
File "/usr/lib/python2.7/site-packages/salt/modules/linux_sysctl.py", line 86, in show
for line in salt.utils.fopen(config_file_path):
File "/usr/lib/python2.7/site-packages/salt/utils/__init__.py", line 1065, in fopen
fhandle = open(*args, **kwargs)
IOError: [Errno 2] No such file or directory: '/etc/sysctl.d/99-salt.conf'
The corresponding state had a config file specified that was ignored. But this would hold true for any
minion meeting the systemd conditions and not having 99-salt.conf. Now, for normal highstate runs, the current
and configured options are not run unless test is specified and if the configured check returns none, the
user will be notified that there was an issue reading the default/specified file.
Platforms other than linux also appeared to not have the config_file argument for show() that would have probably (I did not verify) bail out with argument number errors during normal runs.
Conflicts:
salt/modules/netbsd_sysctl.py
salt/modules/openbsd_sysctl.py
On a requisite failure, instead of saying "something failed" we can determine what the failures where by looking at the requisites of the lowstate running, and see which ones failed.
Before the fix in #18363 get_event would return None on the first non-matching event (since wait was 0), this is to verify that get_event works properly with a wait of 0
states/sysctl calls sysctl.persist with config file, regardless of the
OS. *_sysctl do have that parameter, but netbsd_sysctl.
Now, netbsd_sysctl takes a config file with a default value like the
others.