ffad305fd3
Why I did it Initial implementation of Watchdog platform plugin for BMC-based boards How I did it How to verify it Run platform_tests/test_reload_config.py
46 lines
1.6 KiB
Python
46 lines
1.6 KiB
Python
#!/usr/bin/env python
|
|
|
|
import syslog
|
|
from sonic_platform_base.watchdog_base import WatchdogBase
|
|
|
|
class Watchdog(WatchdogBase):
|
|
def arm(self, seconds):
|
|
"""
|
|
Arm the hardware watchdog with a timeout of <seconds> seconds.
|
|
If the watchdog is currently armed, calling this function will
|
|
simply reset the timer to the provided value. If the underlying
|
|
hardware does not support the value provided in <seconds>, this
|
|
method should arm the watchdog with the *next greater* available
|
|
value.
|
|
Returns:
|
|
An integer specifying the *actual* number of seconds the watchdog
|
|
was armed with. On failure returns -1.
|
|
"""
|
|
syslog.syslog(syslog.LOG_WARNING, "The watchdog arm operation is not supported in this revision of the plugin!")
|
|
return -1
|
|
|
|
def disarm(self):
|
|
"""
|
|
Disarm the hardware watchdog
|
|
Returns:
|
|
A boolean, True if watchdog is disarmed successfully, False if not
|
|
"""
|
|
return True
|
|
|
|
def is_armed(self):
|
|
"""
|
|
Retrieves the armed state of the hardware watchdog.
|
|
Returns:
|
|
A boolean, True if watchdog is armed, False if not
|
|
"""
|
|
return False
|
|
|
|
def get_remaining_time(self):
|
|
"""
|
|
If the watchdog is armed, retrieve the number of seconds remaining on
|
|
the watchdog timer
|
|
Returns:
|
|
An integer specifying the number of seconds remaining on thei
|
|
watchdog timer. If the watchdog is not armed, returns -1.
|
|
"""
|
|
return -1 |