class SimpleStore(object):
Interface to static cluster data.
This is different that the config.ConfigWriter and SimpleConfigReader classes in that it holds data that will always be present, even on nodes which don't have all the cluster data.
Other particularities of the datastore:
- keys are restricted to predefined values
Method | __init__ |
Undocumented |
Method |
|
Get the cluster name. |
Method |
|
Return the cluster tags. |
Method |
|
Return whether user shutdown is enabled. |
Method |
|
Return the list of all config files. |
Method |
|
Get the file storage dir. |
Method |
|
Get the Gluster storage dir. |
Method |
|
Return the hypervisor parameters of all hypervisors. |
Method |
|
Return the hypervisor parameters of the given hypervisor. |
Method |
|
Return the list of enabled hypervisors. |
Method |
|
Return the value of the maintain_node_health option. |
Method |
|
Return the list of master candidates. |
Method |
|
Returns the map of master candidate UUIDs to ssl cert. |
Method |
|
Return the list of master candidates' primary IP. |
Method |
|
Get the IP of the master node for this cluster. |
Method |
|
Get the netdev to which we'll add the master ip. |
Method |
|
Get the master netmask. |
Method |
|
Get the hostname of the master node for this cluster. |
Method |
|
Return the list of networks. |
Method |
|
Return the list of nodegroups. |
Method |
|
Return the list of cluster nodes. |
Method |
|
Return the list of cluster nodes' primary IP. |
Method |
|
Return the list of cluster nodes' secondary IP. |
Method |
|
Return the cluster nodes' vm capable value. |
Method |
|
Return the list of online cluster nodes. |
Method |
|
Return the cluster-wide primary address family. |
Method |
|
Get the shared file storage dir. |
Method |
|
Returns the map of node names to SSH port. |
Method |
|
Return the user-id pool definition string. |
Method |
|
Convert a given key into filename. |
Method |
|
Reads all keys and returns their values. |
Method |
|
Writes ssconf files used by external scripts. |
Method | _ |
Reads a file with lines like key=value and returns a dict. |
Method | _ |
Generic routine to read keys. |
Instance Variable | _cfg |
Undocumented |
Instance Variable | _lockfile |
Undocumented |
Return whether user shutdown is enabled.
Returns | |
bool | 'True' if user shutdown is enabled, 'False' otherwise |
Return the hypervisor parameters of all hypervisors.
Returns | |
dict of dict of strings | dictionary mapping hypervisor names to hvparams |
Return the hypervisor parameters of the given hypervisor.
Parameters | |
hvname:string | name of the hypervisor, must be in constants.HYPER_TYPES |
Returns | |
dict of strings | dictionary with hypervisor parameters |
Returns the map of master candidate UUIDs to ssl cert.
Returns | |
dict of string to string | dictionary mapping the master candidates' UUIDs to their SSL certificate digests |
Return the cluster nodes' vm capable value.
Returns | |
dict of string to bool | mapping of node names to vm capable values |
Returns the map of node names to SSH port.
Returns | |
dict of string to string | dictionary mapping the node names to their SSH port |
Return the user-id pool definition string.
The separator character is a newline.
The return value can be parsed using uidpool.ParseUidPool():
ss = ssconf.SimpleStore() uid_pool = uidpool.ParseUidPool(ss.GetUidPool(), separator="\n")
Writes ssconf files used by external scripts.
Parameters | |
values:dict | Dictionary of (name, value) @type dry_run boolean |
dry | Whether to perform a dry run |
Reads a file with lines like key=value and returns a dict.
This utility function reads a file containing ssconf values of the form "key=value", splits the lines at "=" and returns a dictionary mapping the keys to the values.
Parameters | |
ss | the constant referring to an ssconf file |
Returns | |
dict of string to string | a dictionary mapping the keys to the values |