Commit 6f076453 authored by Guido Trotter's avatar Guido Trotter
Browse files

Export nodegroups list (names/uuids) via ssconf


Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 190e3cb6
......@@ -1485,6 +1485,10 @@ class ConfigWriter:
uid_pool = uidpool.FormatUidPool(cluster.uid_pool, separator="\n")
nodegroups = ["%s %s" % (nodegroup.uuid, nodegroup.name) for nodegroup in
self._config_data.nodegroups.values()]
nodegroups_data = fn(utils.NiceSort(nodegroups))
return {
constants.SS_CLUSTER_NAME: cluster.cluster_name,
constants.SS_CLUSTER_TAGS: cluster_tags,
......@@ -1505,6 +1509,7 @@ class ConfigWriter:
constants.SS_HYPERVISOR_LIST: hypervisor_list,
constants.SS_MAINTAIN_NODE_HEALTH: str(cluster.maintain_node_health),
constants.SS_UID_POOL: uid_pool,
constants.SS_NODEGROUPS: nodegroups_data,
}
@locking.ssynchronized(_config_lock, shared=1)
......
......@@ -904,6 +904,7 @@ SS_RELEASE_VERSION = "release_version"
SS_HYPERVISOR_LIST = "hypervisor_list"
SS_MAINTAIN_NODE_HEALTH = "maintain_node_health"
SS_UID_POOL = "uid_pool"
SS_NODEGROUPS = "nodegroups"
# cluster wide default parameters
DEFAULT_ENABLED_HYPERVISOR = HT_XEN_PVM
......
......@@ -288,6 +288,7 @@ class SimpleStore(object):
constants.SS_HYPERVISOR_LIST,
constants.SS_MAINTAIN_NODE_HEALTH,
constants.SS_UID_POOL,
constants.SS_NODEGROUPS,
)
_MAX_SIZE = 131072
......@@ -426,6 +427,14 @@ class SimpleStore(object):
nl = data.splitlines(False)
return nl
def GetNodegroupList(self):
"""Return the list of nodegroups.
"""
data = self._ReadFile(constants.SS_NODEGROUPS)
nl = data.splitlines(False)
return nl
def GetClusterTags(self):
"""Return the cluster tags.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment