mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Use new utils function to check systemd version
This commit is contained in:
parent
ee570cf0a2
commit
75c53006d8
@ -57,22 +57,9 @@ def default_config():
|
||||
|
||||
salt -G 'kernel:Linux' sysctl.default_config
|
||||
'''
|
||||
if salt.utils.systemd.booted(__context__):
|
||||
for line in __salt__['cmd.run_stdout'](
|
||||
'systemctl --version'
|
||||
).splitlines():
|
||||
if line.startswith('systemd '):
|
||||
version = line.split()[-1]
|
||||
try:
|
||||
if int(version) >= 207:
|
||||
return _check_systemd_salt_config()
|
||||
except ValueError:
|
||||
log.error(
|
||||
'Unexpected non-numeric systemd version {0!r} '
|
||||
'detected'.format(version)
|
||||
)
|
||||
break
|
||||
|
||||
if salt.utils.systemd.booted(__context__) \
|
||||
and salt.utils.systemd.version(__context__) >= 207:
|
||||
return _check_systemd_salt_config()
|
||||
return '/etc/sysctl.conf'
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user