diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2021-08-04 12:30:58 +0400 |
---|---|---|
committer | Markus Armbruster <armbru@redhat.com> | 2021-08-26 13:53:56 +0200 |
commit | 33aa3267bacc5a7af363c0ffa5f1bdabba54b989 (patch) | |
tree | d2a5887804da5d4c5e7a69b4de79688449c900c2 /scripts/qapi/introspect.py | |
parent | f17539c80da3c0ebabbe75a04f5451995367ec91 (diff) |
qapi: add QAPISchemaIfCond.is_present()
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20210804083105.97531-4-marcandre.lureau@redhat.com>
Signed-off-by: Markus Armbruster <armbru@redhat.com>
Diffstat (limited to 'scripts/qapi/introspect.py')
-rw-r--r-- | scripts/qapi/introspect.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/qapi/introspect.py b/scripts/qapi/introspect.py index db1ebbf53a..e23725e2f9 100644 --- a/scripts/qapi/introspect.py +++ b/scripts/qapi/introspect.py @@ -123,10 +123,10 @@ def _tree_to_qlit(obj: JSONValue, ret = '' if obj.comment: ret += indent(level) + f"/* {obj.comment} */\n" - if obj.ifcond.ifcond: + if obj.ifcond.is_present(): ret += gen_if(obj.ifcond.ifcond) ret += _tree_to_qlit(obj.value, level) - if obj.ifcond.ifcond: + if obj.ifcond.is_present(): ret += '\n' + gen_endif(obj.ifcond.ifcond) return ret |