From 911ee606025e2ba89a4837858766ba455c52d50c Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Thu, 20 Dec 2012 13:57:20 +0100 Subject: [PATCH] opcodes: Common parameter for target groups Also add a missing parenthesis at the end. Signed-off-by: Michael Hanselmann <hansmi@google.com> Reviewed-by: Guido Trotter <ultrotter@google.com> --- lib/opcodes.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/opcodes.py b/lib/opcodes.py index fbae1d1ae..cac8fc05f 100644 --- a/lib/opcodes.py +++ b/lib/opcodes.py @@ -180,6 +180,10 @@ _PIAllocFromDesc = lambda desc: ("iallocator", None, ht.TMaybeString, desc) _PNetworkName = ("network_name", ht.NoDefault, ht.TNonEmptyString, "Set network name") +_PTargetGroups = \ + ("target_groups", None, ht.TMaybeListOf(ht.TNonEmptyString), + "Destination group names or UUIDs (defaults to \"all but current group\")") + #: OP_ID conversion regular expression _OPID_RE = re.compile("([a-z])([A-Z])") @@ -1702,8 +1706,7 @@ class OpInstanceChangeGroup(OpCode): _PInstanceName, _PEarlyRelease, _PIAllocFromDesc("Iallocator for computing solution"), - ("target_groups", None, ht.TMaybeListOf(ht.TNonEmptyString), - "Destination group names or UUIDs (defaults to \"all but current group\""), + _PTargetGroups, ] OP_RESULT = TJobIdListOnly @@ -1788,8 +1791,7 @@ class OpGroupEvacuate(OpCode): _PGroupName, _PEarlyRelease, _PIAllocFromDesc("Iallocator for computing solution"), - ("target_groups", None, ht.TMaybeListOf(ht.TNonEmptyString), - "Destination group names or UUIDs"), + _PTargetGroups, ] OP_RESULT = TJobIdListOnly -- GitLab