patroni.watchdog.linux module

patroni.watchdog.linux.IOC(dir: int, _type: str, _nr: int, size: int) → int View on GitHub
patroni.watchdog.linux.IOR(type: str, _nr: int, size: int) → int View on GitHub
patroni.watchdog.linux.IOW(type: str, _nr: int, size: int) → int View on GitHub
patroni.watchdog.linux.IOWR(type: str, _nr: int, size: int) → int View on GitHub
class _patroni.watchdog.linux.LinuxWatchdogDevice(_device: str) View on GitHub

Bases: WatchdogBase +

DEFAULT_DEVICE_ = '/dev/watchdog'_

+

__init\\__(device: str) → None View on GitHub

+

abc_impl = <_abc._abc_data object>_

+

ioctl(_func: int, arg: Any) → None View on GitHub

Runs the specified ioctl on the underlying fd.
Raises WatchdogError if the device is closed. Raises OSError or IOError (Python 2) when the ioctl fails. +

property _can_be_disabled: bool_

Returns True when watchdog will be disabled by calling close(). Some watchdog devices will keep running no matter what once activated. May raise WatchdogError if called without calling open() first. +

close() → None View on GitHub

Gracefully close watchdog device. +

describe() → str View on GitHub

Human readable name for this device +

classmethod _from_config(_config: Dict[ str, Any]) → LinuxWatchdogDevice View on GitHub

+

get_support() → WatchdogInfo View on GitHub

+

get_timeout() → int View on GitHub

Returns the current keepalive timeout in effect. +

has_set_timeout() → bool View on GitHub

Returns True if setting a timeout is supported. +

property _is_healthy: bool_

Returns False when calling open() is known to fail. +

property _is_running: bool_

Returns True when watchdog is activated and capable of performing it’s task. +

keepalive() → None View on GitHub

Resets the watchdog timer.
Watchdog must be open when keepalive is called. +

open() → None View on GitHub

Open watchdog device.
When watchdog is opened keepalive must be called. Returns nothing on success or raises WatchdogError if the device could not be opened. +

set_timeout(timeout: int) → None View on GitHub

Set the watchdog timer timeout. +

Parameters

timeout – watchdog timeout in seconds

class _patroni.watchdog.linux.TestingWatchdogDevice(_device: str) View on GitHub

Bases: LinuxWatchdogDevice + Converts timeout ioctls to regular writes that can be intercepted from a named pipe. +

abc_impl = <_abc._abc_data object>_

+

get_support() → WatchdogInfo View on GitHub

+

get_timeout() → int View on GitHub

Returns the current keepalive timeout in effect. +

set_timeout(timeout: int) → None View on GitHub

Set the watchdog timer timeout. +

Parameters

timeout – watchdog timeout in seconds +

timeout_ = 60_
class _patroni.watchdog.linux.WatchdogInfo(_options: int, version: int, identity: str) View on GitHub

Bases: NamedTuple + Watchdog descriptor from the kernel +

_asdict() View on GitHub

Return a new dict which maps field names to their values. +

field_defaults = \{}_

+

fields = ('options', 'version', 'identity')_

+

classmethod \\__make(_iterable) View on GitHub

Make a new WatchdogInfo object from a sequence or iterable +

replace(**kwds_) View on GitHub

Return a new WatchdogInfo object replacing specified fields with new values +

identity_: str_

Alias for field number 2 +

options_: int_

Alias for field number 0 +

version_: int_

Alias for field number 1

_class _patroni.watchdog.linux.watchdog_info View on GitHub

Bases: Structure +

fields\\_ =

+

firmware_version

Structure/Union member +

identity

Structure/Union member +

options

Structure/Union member


© Copyright 2015 Compose, Zalando SE. Revision 9d231aee.

Built with Sphinx using a theme provided by Read the Docs.

Read the Docs v: latest

+ Builds