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.
---
 lib/client/gnt_debug.py |    6 +++++-
 lib/cmdlib.py           |    2 +-
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/lib/client/gnt_debug.py b/lib/client/gnt_debug.py
index a327321..6985781 100644
--- a/lib/client/gnt_debug.py
+++ b/lib/client/gnt_debug.py
@@ -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
diff --git a/lib/cmdlib.py b/lib/cmdlib.py
index b4fd489..8274d81 100644
--- a/lib/cmdlib.py
+++ b/lib/cmdlib.py
@@ -12019,7 +12019,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
-- 
1.7.3.1

Reply via email to