mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-07-27 04:13:53 -06:00
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>
This commit is contained in:
parent
6dcf03719a
commit
34f7b25e57
4 changed files with 6 additions and 7 deletions
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue