+ def GetNodePrimaryIPList(self):
+ """Return the list of cluster nodes' primary IP.
+
+ """
+ data = self._ReadFile(constants.SS_NODE_PRIMARY_IPS)
+ nl = data.splitlines(False)
+ return nl
+
+ def GetNodeSecondaryIPList(self):
+ """Return the list of cluster nodes' secondary IP.
+
+ """
+ data = self._ReadFile(constants.SS_NODE_SECONDARY_IPS)
+ 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 GetNetworkList(self):
+ """Return the list of networks.
+
+ """
+ data = self._ReadFile(constants.SS_NETWORKS)
+ nl = data.splitlines(False)
+ return nl
+
+ def GetClusterTags(self):
+ """Return the cluster tags.
+
+ """
+ data = self._ReadFile(constants.SS_CLUSTER_TAGS)
+ nl = data.splitlines(False)
+ return nl
+
+ def GetHypervisorList(self):
+ """Return the list of enabled hypervisors.
+
+ """
+ data = self._ReadFile(constants.SS_HYPERVISOR_LIST)
+ nl = data.splitlines(False)
+ return nl
+
+ def GetMaintainNodeHealth(self):
+ """Return the value of the maintain_node_health option.
+
+ """
+ data = self._ReadFile(constants.SS_MAINTAIN_NODE_HEALTH)
+ # we rely on the bool serialization here
+ return data == "True"
+
+ def GetUidPool(self):
+ """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")
+
+ """
+ data = self._ReadFile(constants.SS_UID_POOL)
+ return data
+
+ def GetPrimaryIPFamily(self):
+ """Return the cluster-wide primary address family.
+
+ """
+ try:
+ return int(self._ReadFile(constants.SS_PRIMARY_IP_FAMILY,
+ default=netutils.IP4Address.family))
+ except (ValueError, TypeError), err:
+ raise errors.ConfigurationError("Error while trying to parse primary IP"
+ " family: %s" % err)
+
+
+def WriteSsconfFiles(values, dry_run=False):
+ """Update all ssconf files.
+
+ Wrapper around L{SimpleStore.WriteFiles}.
+
+ """
+ SimpleStore().WriteFiles(values, dry_run=dry_run)
+