From 3ad64edfad2fa404e866c01f6d427ed4fe4f4f0f Mon Sep 17 00:00:00 2001 From: Marc-André Lureau Date: Wed, 4 Aug 2021 12:31:02 +0400 Subject: qapi: add 'any' condition MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Marc-André Lureau Message-Id: <20210804083105.97531-8-marcandre.lureau@redhat.com> Reviewed-by: Markus Armbruster Signed-off-by: Markus Armbruster --- scripts/qapi/expr.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'scripts/qapi/expr.py') diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py index d7a34655a7..f3ce10fb3e 100644 --- a/scripts/qapi/expr.py +++ b/scripts/qapi/expr.py @@ -290,16 +290,16 @@ def check_if(expr: _JSONObject, info: QAPISourceInfo, source: str) -> None: raise QAPISemError( info, "'if' condition dict of %s must have one key: " - "'all'" % source) + "'all' or 'any'" % source) check_keys(cond, info, "'if' condition", [], - ["all"]) + ["all", "any"]) oper, operands = next(iter(cond.items())) if not operands: raise QAPISemError( info, "'if' condition [] of %s is useless" % source) - if oper in ("all") and not isinstance(operands, list): + if oper in ("all", "any") and not isinstance(operands, list): raise QAPISemError( info, "'%s' condition of %s must be an array" % (oper, source)) for operand in operands: -- cgit 1.4.1