From 202fb4e0d31a1be0e454211f24c2ff688d2caecc Mon Sep 17 00:00:00 2001 From: Michael Hanselmann <hansmi@google.com> Date: Mon, 20 Feb 2012 17:21:51 +0100 Subject: [PATCH] opcodes: Add result checks for OpBackup* Signed-off-by: Michael Hanselmann <hansmi@google.com> Reviewed-by: Iustin Pop <iustin@google.com> --- lib/opcodes.py | 9 +++++++++ test/ganeti.opcodes_unittest.py | 3 --- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/lib/opcodes.py b/lib/opcodes.py index bdcddc50e..d99636e1f 100644 --- a/lib/opcodes.py +++ b/lib/opcodes.py @@ -1612,6 +1612,9 @@ class OpBackupQuery(OpCode): ("nodes", ht.EmptyList, ht.TListOf(ht.TNonEmptyString), "Empty list to query all nodes, node names otherwise"), ] + OP_RESULT = ht.TDictOf(ht.TNonEmptyString, + ht.TOr(ht.Comment("False on error")(ht.TBool), + ht.TListOf(ht.TNonEmptyString))) class OpBackupPrepare(OpCode): @@ -1666,6 +1669,11 @@ class OpBackupExport(OpCode): ("destination_x509_ca", None, ht.TMaybeString, "Destination X509 CA (remote export only)"), ] + OP_RESULT = \ + ht.TAnd(ht.TIsLength(2), ht.TItems([ + ht.Comment("Finalizing status")(ht.TBool), + ht.Comment("Status for every exported disk")(ht.TListOf(ht.TBool)), + ])) class OpBackupRemove(OpCode): @@ -1674,6 +1682,7 @@ class OpBackupRemove(OpCode): OP_PARAMS = [ _PInstanceName, ] + OP_RESULT = ht.TNone # Tags opcodes diff --git a/test/ganeti.opcodes_unittest.py b/test/ganeti.opcodes_unittest.py index 099800f4d..a31503e96 100755 --- a/test/ganeti.opcodes_unittest.py +++ b/test/ganeti.opcodes_unittest.py @@ -38,9 +38,6 @@ import testutils #: Unless an opcode is included in the following list it must have a result #: check of some sort MISSING_RESULT_CHECK = frozenset([ - opcodes.OpBackupExport, - opcodes.OpBackupQuery, - opcodes.OpBackupRemove, opcodes.OpClusterQuery, opcodes.OpGroupQuery, opcodes.OpInstanceQuery, -- GitLab