module documentation

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 SimpleStore Interface to static cluster data.
Function CheckMaster Checks the node setup.
Function GetMasterAndMyself Get the master node and my own hostname.
Function ReadSsconfFile Reads an ssconf file and verifies its size.
Function VerifyClusterName Verifies cluster name against a local cluster name.
Function VerifyKeys Raises an exception if unknown ssconf keys are given.
Function WriteSsconfFiles Update all ssconf files.
Constant SSCONF_LOCK_TIMEOUT Undocumented
Constant _MAX_SIZE Undocumented
def CheckMaster(debug, ss=None):

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.

def GetMasterAndMyself(ss=None):

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
sseither a sstore.SimpleConfigReader or a sstore.SimpleStore instance
Returns
tuplea tuple (master node name, my own name)
def ReadSsconfFile(filename):

Reads an ssconf file and verifies its size.

Parameters
filename:stringPath to file
Returns
stringFile contents without newlines at the end
Raises
RuntimeErrorWhen the file size exceeds _MAX_SIZE
def VerifyClusterName(name, _cfg_location=None):

Verifies cluster name against a local cluster name.

Parameters
name:stringCluster name
_cfg_locationUndocumented
def VerifyKeys(keys):

Raises an exception if unknown ssconf keys are given.

Parameters
keys:sequenceKey names to verify
Raises
errors.GenericErrorWhen invalid keys were found
def WriteSsconfFiles(values, dry_run=False):

Update all ssconf files.

Wrapper around SimpleStore.WriteFiles.

SSCONF_LOCK_TIMEOUT: int =

Undocumented

Value
10
_MAX_SIZE =

Undocumented

Value
128*1024