summary refs log tree commit diff stats
path: root/scripts/qapi
diff options
context:
space:
mode:
authorMarkus Armbruster <armbru@redhat.com>2021-08-31 14:38:09 +0200
committerMarkus Armbruster <armbru@redhat.com>2021-09-03 17:09:10 +0200
commit34f7b25e575a93182b7c0a3558caac34e26227cf (patch)
tree26832d9642e0a8d41f2b6fe8ce90aecbea6b8360 /scripts/qapi
parent6dcf03719acc4db6db7dc307359ff67d05e74451 (diff)
downloadfocaccia-qemu-34f7b25e575a93182b7c0a3558caac34e26227cf.tar.gz
focaccia-qemu-34f7b25e575a93182b7c0a3558caac34e26227cf.zip
qapi: Tweak error messages for unknown / conflicting 'if' keys
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210831123809.1107782-13-armbru@redhat.com>
Reviewed-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Diffstat (limited to 'scripts/qapi')
-rw-r--r--scripts/qapi/expr.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/scripts/qapi/expr.py b/scripts/qapi/expr.py
index ae4437ba08..b62f0a3640 100644
--- a/scripts/qapi/expr.py
+++ b/scripts/qapi/expr.py
@@ -286,13 +286,12 @@ def check_if(expr: _JSONObject, info: QAPISourceInfo, source: str) -> None:
             raise QAPISemError(
                 info,
                 "'if' condition of %s must be a string or an object" % source)
+        check_keys(cond, info, "'if' condition of %s" % source, [],
+                   ["all", "any", "not"])
         if len(cond) != 1:
             raise QAPISemError(
                 info,
-                "'if' condition dict of %s must have one key: "
-                "'all', 'any' or 'not'" % source)
-        check_keys(cond, info, "'if' condition", [],
-                   ["all", "any", "not"])
+                "'if' condition of %s has conflicting keys" % source)
 
         oper, operands = next(iter(cond.items()))
         if not operands: