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

Class SimpleConfigReader

source code


Simple class to read configuration file.

Instance Methods [hide private]
 
__init__(self, file_name=constants.CLUSTER_CONF_FILE)
Initializes this class.
source code
boolean
_Load(self, force=False)
Loads (or reloads) the config file.
source code
boolean
Reload(self, force=False)
Loads (or reloads) the config file.
source code
 
GetClusterName(self) source code
 
GetHostKey(self) source code
 
GetMasterNode(self) source code
 
GetMasterIP(self) source code
 
GetMasterNetdev(self) source code
 
GetFileStorageDir(self) source code
 
GetNodeList(self) source code
 
GetConfigSerialNo(self) source code
 
GetClusterSerialNo(self) source code
 
GetDefaultNicParams(self) source code
 
GetDefaultNicLink(self) source code
(bool, bool, bool)
GetNodeStatusFlags(self, node)
Get a node's status flags
source code
string
GetInstanceByLinkIp(self, ip, link)
Get instance name from its link and ip address.
source code
string, or None
GetNodePrimaryIp(self, node)
Get a node's primary ip
source code
string, or None
GetInstancePrimaryNode(self, instance)
Get an instance's primary node
source code
 
GetNodesPrimaryIps(self) source code
 
GetMasterCandidatesPrimaryIps(self) source code
list
GetInstancesIps(self, link)
Get list of nic ips connected to a certain link.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, file_name=constants.CLUSTER_CONF_FILE)
(Constructor)

source code 

Initializes this class.

Parameters:
  • file_name (string) - Configuration file path
Overrides: object.__init__

_Load(self, force=False)

source code 

Loads (or reloads) the config file.

Parameters:
  • force (boolean) - whether to force the reload without checking the mtime
Returns: boolean
boolean value that says whether we reloaded the configuration or not (because we decided it was already up-to-date)

Reload(self, force=False)

source code 

Loads (or reloads) the config file.

Parameters:
  • force (boolean) - whether to force the reload without checking the mtime
Returns: boolean
boolean value that says whether we reloaded the configuration or not (because we decided it was already up-to-date)

GetNodeStatusFlags(self, node)

source code 

Get a node's status flags

Parameters:
  • node (string) - node name
Returns: (bool, bool, bool)
(master_candidate, drained, offline) (or None if no such node)

GetInstanceByLinkIp(self, ip, link)

source code 

Get instance name from its link and ip address.

Parameters:
  • ip (string) - ip address
  • link (string) - nic link
Returns: string
instance name

GetNodePrimaryIp(self, node)

source code 

Get a node's primary ip

Parameters:
  • node (string) - node name
Returns: string, or None
node's primary ip, or None if no such node

GetInstancePrimaryNode(self, instance)

source code 

Get an instance's primary node

Parameters:
  • instance (string) - instance name
Returns: string, or None
primary node, or None if no such instance

GetInstancesIps(self, link)

source code 

Get list of nic ips connected to a certain link.

Parameters:
  • link (string) - nic link
Returns: list
list of ips connected to that link