Commit ace16501 authored by Guido Trotter's avatar Guido Trotter
Browse files

Check for duplicate nodegroup names

Since the nodegroups dict is indexed by uuid duplicate names might
happen as a result of bugs. Add a check to prevent them.
Signed-off-by: default avatarGuido Trotter <>
Reviewed-by: default avatarIustin Pop <>
parent c60abd62
......@@ -462,11 +462,16 @@ class ConfigWriter:
# nodegroups checks
nodegroups_names = set()
for nodegroup_uuid in data.nodegroups:
nodegroup = data.nodegroups[nodegroup_uuid]
if nodegroup.uuid != nodegroup_uuid:
result.append("nodegroup '%s' (uuid: '%s') indexed by wrong uuid '%s'"
% (, nodegroup.uuid, nodegroup_uuid))
if in nodegroups_names:
result.append("duplicate nodegroup name '%s'" %
# drbd minors check
_, duplicates = self._UnlockedComputeDRBDMap()
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