Pacemaker Python Module¶
This is the Python interface to the Pacemaker project. At the moment, it doesn’t do very much but we are planning to expand its capabilities over time.
API Reference¶
Pacemaker¶
The pacemaker module re-exports its submodules, so code should import directly from
the pacemaker
module:
>>> from pacemaker import BuildOptions
Build Options¶
- class pacemaker.BuildOptions¶
Variables generated as part of the ./configure && make process.
These affect how pacemaker was configured and where its various parts get installed.
- BASH_PATH = '/usr/bin/bash'¶
Path to the bash shell.
- CIB_DIR = '/var/lib/pacemaker/cib'¶
Where CIB files are stored.
- CIB_SCHEMA_VERSION = '4.0'¶
Latest supported CIB schema version number.
- COROSYNC_CONFIG_FILE = '/etc/corosync/corosync.conf'¶
Path to the corosync config file.
- DAEMON_DIR = '/usr/libexec/pacemaker'¶
Where Pacemaker daemons are installed.
- DAEMON_USER = 'hacluster'¶
User to run Pacemaker daemons as.
- DATA_DIR = '/usr/share'¶
Where read-only architecture-independent data is stored.
- INIT_DIR = '/etc/init.d'¶
Where LSB init scripts are stored.
- LIBEXEC_DIR = '/usr/libexec'¶
Where programs started by other programs are stored.
- LOCAL_STATE_DIR = '/var'¶
Where miscellaneous temporary state files are stored.
- LOG_DIR = '/var/log/pacemaker'¶
Where Pacemaker log files are stored.
- OCF_RA_INSTALL_DIR = '/usr/lib/ocf/resource.d'¶
Where resource agents are installed.
- OCF_ROOT_DIR = '/usr/lib/ocf'¶
Root directory for OCF resource agents and libraries.
- PACEMAKER_CONFIG_DIR = '/etc/pacemaker'¶
Where configuration files such as authkey are kept.
- REMOTE_ENABLED = True¶
True if Pacemaker Remote support is enabled.
- RSC_TMP_DIR = '/var/run/resource-agents'¶
Where resource agents should keep state files.
- RUNTIME_STATE_DIR = '/var/run'¶
Where runtime data is stored.
- SBIN_DIR = '/usr/sbin'¶
Where administrative programs are installed.
- SCHEMA_DIR = '/usr/share/pacemaker'¶
Where Relax-NG schema files are stored.
- UNIT_DIR = '/usr/lib/systemd/system'¶
Where system-wide systemd unit files are stored.
- XMLLINT_PATH = '/usr/bin/xmllint'¶
Path to the xmllint program.
Exit Status¶
- class pacemaker.ExitStatus(value, names=<not given>, *values, module=None, qualname=None, type=None, start=1, boundary=None)¶
Exit status codes for a function or process.
These constants describe both success and failure conditions.
- CANTCREAT = 73¶
- CONFIG = 78¶
- DATAERR = 65¶
- DEGRADED = 190¶
- DEGRADED_PROMOTED = 191¶
- DIGEST = 104¶
- DISCONNECT = 102¶
- ERROR = 1¶
- EXISTS = 108¶
- EXPIRED = 110¶
- FAILED_PROMOTED = 9¶
- FATAL = 100¶
- INDETERMINATE = 112¶
- INSUFFICIENT_PRIV = 4¶
- INVALID_PARAM = 2¶
- IOERR = 74¶
- MAX = 255¶
- MULTIPLE = 109¶
- NOHOST = 68¶
- NOINPUT = 66¶
- NONE = 193¶
- NOPERM = 77¶
- NOSUCH = 105¶
- NOT_CONFIGURED = 6¶
- NOT_INSTALLED = 5¶
- NOT_RUNNING = 7¶
- NOT_YET_IN_EFFECT = 111¶
- NOUSER = 67¶
- NO_DC = 114¶
- OK = 0¶
- OLD = 103¶
- OSERR = 71¶
- OSFILE = 72¶
- PANIC = 101¶
- PROMOTED = 8¶
- PROTOCOL = 76¶
- QUORUM = 106¶
- SOFTWARE = 70¶
- TEMPFAIL = 75¶
- TIMEOUT = 124¶
- UNAVAILABLE = 69¶
- UNIMPLEMENT_FEATURE = 3¶
- UNSAFE = 107¶
- UNSATISFIED = 113¶
- USAGE = 64¶