From 4b9e8c931ace3773b5b25ad93714f89303f15a97 Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Thu, 12 May 2011 13:34:23 +0200 Subject: [PATCH] Abstract ignore_consistency opcode parameter MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Two opcodes already use it and we need it for a third, time to add a constant for it. Signed-off-by: Iustin Pop <iustin@google.com> Reviewed-by: RenΓ© Nussbaumer <rn@google.com> --- lib/opcodes.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/opcodes.py b/lib/opcodes.py index 85ec44526..5362895e7 100644 --- a/lib/opcodes.py +++ b/lib/opcodes.py @@ -78,6 +78,9 @@ _PTagKind = ("kind", ht.NoDefault, ht.TElemOf(constants.VALID_TAG_TYPES)) #: List of tag strings _PTags = ("tags", ht.NoDefault, ht.TListOf(ht.TNonEmptyString)) +#: Ignore consistency +_PIgnoreConsistency = ("ignore_consistency", False, ht.TBool) + #: OP_ID conversion regular expression _OPID_RE = re.compile("([a-z])([A-Z])") @@ -696,8 +699,8 @@ class OpRepairNodeStorage(OpCode): OP_PARAMS = [ _PNodeName, _PStorageType, + _PIgnoreConsistency, ("name", ht.NoDefault, ht.TNonEmptyString), - ("ignore_consistency", False, ht.TBool), ] @@ -879,7 +882,7 @@ class OpInstanceFailover(OpCode): OP_PARAMS = [ _PInstanceName, _PShutdownTimeout, - ("ignore_consistency", False, ht.TBool), + _PIgnoreConsistency, ] -- GitLab