Commit 485ba212 authored by Guido Trotter's avatar Guido Trotter
Browse files

Avoid nodegroup name/uuid conflicts



Forbid nodegroups to be called with a name that matches the UUID regular
expression. Uppercase versions are forbidden as well.
Signed-off-by: default avatarGuido Trotter <ultrotter@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent 05636402
......@@ -468,6 +468,9 @@ class ConfigWriter:
if nodegroup.uuid != nodegroup_uuid:
result.append("nodegroup '%s' (uuid: '%s') indexed by wrong uuid '%s'"
% (nodegroup.name, nodegroup.uuid, nodegroup_uuid))
if utils.UUID_RE.match(nodegroup.name.lower()):
result.append("nodegroup '%s' (uuid: '%s') has uuid-like name" %
(nodegroup.name, nodegroup.uuid))
if nodegroup.name in nodegroups_names:
result.append("duplicate nodegroup name '%s'" % nodegroup.name)
else:
......
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