Commit 9a5fba23 authored by Guido Trotter's avatar Guido Trotter
Browse files

Add a few more checks to verify config



- Check that the enabled hypervisors list is valid
- Check that the master node is a valid node
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent b119bccb
......@@ -273,6 +273,20 @@ class ConfigWriter:
data = self._config_data
seen_lids = []
seen_pids = []
# global cluster checks
if not data.cluster.enabled_hypervisors:
result.append("enabled hypervisors list doesn't have any entries")
invalid_hvs = set(data.cluster.enabled_hypervisors) - constants.HYPER_TYPES
if invalid_hvs:
result.append("enabled hypervisors contains invalid entries: %s" %
invalid_hvs)
if data.cluster.master_node not in data.nodes:
result.append("cluster has invalid primary node '%s'" %
data.cluster.master_node)
# per-instance checks
for instance_name in data.instances:
instance = data.instances[instance_name]
if instance.primary_node not in data.nodes:
......
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