Global Configuration data for Ganeti.
This module provides the interface to a special case of cluster configuration data, which is mostly static and available to all nodes.
Class |
|
Interface to static cluster data. |
Function |
|
Checks the node setup. |
Function |
|
Get the master node and my own hostname. |
Function |
|
Reads an ssconf file and verifies its size. |
Function |
|
Verifies cluster name against a local cluster name. |
Function |
|
Raises an exception if unknown ssconf keys are given. |
Function |
|
Update all ssconf files. |
Constant | SSCONF |
Undocumented |
Constant | _MAX |
Undocumented |
Checks the node setup.
If this is the master, the function will return. Otherwise it will exit with an exit code based on the node status.
Get the master node and my own hostname.
This can be either used for a 'soft' check (compared to CheckMaster, which exits) or just for computing both at the same time.
The function does not handle any errors, these should be handled in the caller (errors.ConfigurationError, errors.ResolverError).
Parameters | |
ss | either a sstore.SimpleConfigReader or a sstore.SimpleStore instance |
Returns | |
tuple | a tuple (master node name, my own name) |
Reads an ssconf file and verifies its size.
Parameters | |
filename:string | Path to file |
Returns | |
string | File contents without newlines at the end |
Raises | |
RuntimeError | When the file size exceeds _MAX_SIZE |
Verifies cluster name against a local cluster name.
Parameters | |
name:string | Cluster name |
_cfg | Undocumented |
Raises an exception if unknown ssconf keys are given.
Parameters | |
keys:sequence | Key names to verify |
Raises | |
errors.GenericError | When invalid keys were found |