Package ganeti :: Module ssconf
[hide private]
[frames] | no frames]

Module ssconf

source code

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.

Classes [hide private]
  SimpleConfigReader
Simple class to read configuration file.
  SimpleStore
Interface to static cluster data.
Functions [hide private]
tuple
GetMasterAndMyself(ss=None)
Get the master node and my own hostname.
source code
 
CheckMaster(debug, ss=None)
Checks the node setup.
source code
Variables [hide private]
  SSCONF_LOCK_TIMEOUT = 10
  RE_VALID_SSCONF_NAME = re.compile(r'^[-_a-z0-9]+$')

Imports: sys, re, os, errors, constants, utils, serializer, objects, netutils


Function Details [hide private]

GetMasterAndMyself(ss=None)

source code 

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)

CheckMaster(debug, ss=None)

source code 

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.