mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix system.set_system_time when no hw clock is present
If a hardware clock is not present, then the `cmd.run_all` call in `has_settable_hwclock` will return a non-zero retcode. If `ignore_retcode` is not set to True in that call, then it will set `__context__['retcode']` to that code which will cause the job to appear as if it failed (due to non-zero retcode) even though it didn't really fail. Signed-off-by: Sergey Kizunov <sergey.kizunov@ni.com>
This commit is contained in:
parent
015cbc57d9
commit
281e471853
1 changed files with 4 additions and 1 deletions
|
@ -168,7 +168,10 @@ def has_settable_hwclock():
|
|||
salt '*' system.has_settable_hwclock
|
||||
'''
|
||||
if salt.utils.which_bin(['hwclock']) is not None:
|
||||
res = __salt__['cmd.run_all'](['hwclock', '--test', '--systohc'], python_shell=False)
|
||||
res = __salt__['cmd.run_all'](
|
||||
['hwclock', '--test', '--systohc'], python_shell=False,
|
||||
output_loglevel='quiet', ignore_retcode=True
|
||||
)
|
||||
return res['retcode'] == 0
|
||||
return False
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue