Commit 36bbf5b0 authored by Iustin Pop's avatar Iustin Pop
Browse files

iallocator: change default for target_groups



Per the design doc, the target_groups request key "if present, it must
either be the empty list, or contain a list of group UUIDs". Currently
it defaults to None/null, which is not valid.
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarMichael Hanselmann <hansmi@google.com>
parent ea4dc982
......@@ -155,6 +155,10 @@ def TestAllocator(opts, args):
opts.tags = []
else:
opts.tags = opts.tags.split(",")
if opts.target_groups is None:
target_groups = []
else:
target_groups = opts.target_groups
op = opcodes.OpTestAllocator(mode=opts.mode,
name=args[0],
......@@ -170,7 +174,7 @@ def TestAllocator(opts, args):
direction=opts.direction,
allocator=opts.iallocator,
reloc_mode=opts.reloc_mode,
target_groups=opts.target_groups)
target_groups=target_groups)
result = SubmitOpCode(op, opts=opts)
ToStdout("%s" % result)
return 0
......
......@@ -12013,7 +12013,7 @@ class IAllocator(object):
self.evac_nodes = None
self.instances = None
self.reloc_mode = None
self.target_groups = None
self.target_groups = []
# computed fields
self.required_nodes = None
# init result fields
......
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