From 8e7078e013315055ec2d44635e92871042d28bf1 Mon Sep 17 00:00:00 2001 From: Michael Hanselmann Date: Tue, 8 Mar 2011 14:13:50 +0100 Subject: [PATCH] opcodes: Document OpQueryFields' parameters Signed-off-by: Michael Hanselmann Reviewed-by: Iustin Pop --- lib/opcodes.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/lib/opcodes.py b/lib/opcodes.py index 9a3a53484..acace935a 100644 --- a/lib/opcodes.py +++ b/lib/opcodes.py @@ -109,6 +109,9 @@ _PNodeGroupAllocPolicy = \ _PGroupNodeParams = ("ndparams", None, ht.TMaybeDict, "Default node parameters for group") +_PQueryWhat = ("what", ht.NoDefault, ht.TElemOf(constants.QR_OP_QUERY), + "Resource(s) to query for") + _PIpCheckDoc = "Whether to ensure instance's IP address is inactive" #: OP_ID conversion regular expression @@ -644,8 +647,7 @@ class OpQuery(OpCode): """ OP_PARAMS = [ - ("what", ht.NoDefault, ht.TElemOf(constants.QR_OP_QUERY), - "Resource(s) to query for"), + _PQueryWhat, ("fields", ht.NoDefault, ht.TListOf(ht.TNonEmptyString), "Requested fields"), ("filter", None, ht.TOr(ht.TNone, @@ -662,8 +664,9 @@ class OpQueryFields(OpCode): """ OP_PARAMS = [ - ("what", ht.NoDefault, ht.TElemOf(constants.QR_OP_QUERY), None), - ("fields", None, ht.TOr(ht.TNone, ht.TListOf(ht.TNonEmptyString)), None), + _PQueryWhat, + ("fields", None, ht.TOr(ht.TNone, ht.TListOf(ht.TNonEmptyString)), + "Requested fields; if not given, all are returned"), ] -- GitLab