Commit 6e80da8b authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Small changes in group evacuation



- Use OpPrereqError in CheckPrereq
- Clarify command synopsis
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent a14065ac
......@@ -212,6 +212,7 @@ def EvacuateGroup(opts, args):
return rcode
commands = {
"add": (
AddGroup, ARGS_ONE_GROUP, [DRY_RUN_OPT, ALLOC_POLICY_OPT, NODE_PARAMS_OPT],
......@@ -243,7 +244,8 @@ commands = {
"evacuate": (
EvacuateGroup, [ArgGroup(min=1, max=1)],
[TO_GROUP_OPT, IALLOCATOR_OPT, EARLY_RELEASE_OPT],
"-I <iallocator> [--to <group>]", "Evacuate all instances within a group"),
"[-I <iallocator>] [--to <group>]",
"Evacuate all instances within a group"),
"list-tags": (
ListTags, ARGS_ONE_GROUP, [PRIORITY_OPT],
"<instance_name>", "List the tags of the given instance"),
......
......@@ -12191,7 +12191,8 @@ class LUGroupEvacuate(LogicalUnit):
if group_uuid != self.group_uuid]
if not self.target_uuids:
raise errors.OpExecError("There are no possible target groups")
raise errors.OpPrereqError("There are no possible target groups",
errors.ECODE_INVAL)
def BuildHooksEnv(self):
"""Build hooks env.
......
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