mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Warn if hardware clock sync fails
This commit is contained in:
parent
9cb51fac91
commit
511164e10b
1 changed files with 6 additions and 3 deletions
|
@ -12,6 +12,7 @@ Support for reboot, shutdown, etc on POSIX-like systems.
|
|||
|
||||
"""
|
||||
|
||||
import logging
|
||||
import os.path
|
||||
import re
|
||||
from datetime import datetime, timedelta, tzinfo
|
||||
|
@ -22,6 +23,8 @@ import salt.utils.platform
|
|||
from salt.exceptions import CommandExecutionError, SaltInvocationError
|
||||
from salt.utils.decorators import depends
|
||||
|
||||
log = logging.getLogger(__name__)
|
||||
|
||||
__virtualname__ = "system"
|
||||
|
||||
|
||||
|
@ -202,10 +205,10 @@ def _swclock_to_hwclock():
|
|||
"""
|
||||
res = __salt__["cmd.run_all"](["hwclock", "--systohc"], python_shell=False)
|
||||
if res["retcode"] != 0:
|
||||
msg = "hwclock failed to set hardware clock from software clock: {}".format(
|
||||
res["stderr"]
|
||||
log.warn(
|
||||
"hwclock failed to set hardware clock from software clock: %s",
|
||||
res["stderr"],
|
||||
)
|
||||
raise CommandExecutionError(msg)
|
||||
return True
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue