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>
This commit is contained in:
Marc-André Lureau 2021-08-04 12:30:58 +04:00 committed by Markus Armbruster
parent f17539c80d
commit 33aa3267ba
4 changed files with 12 additions and 9 deletions

View file

@ -94,7 +94,7 @@ class QAPISchemaTestVisitor(QAPISchemaVisitor):
@staticmethod
def _print_if(ifcond, indent=4):
if ifcond.ifcond:
if ifcond.is_present():
print('%sif %s' % (' ' * indent, ifcond.ifcond))
@classmethod