inspection: switch to g.inspect_list_applications2

Use the non-deprecated g.inspect_list_applications2() call to list the
installed applications.  It is available since libguestfs >= 1.20, which
is lower than the current requirement (i.e. 1.22).

Reviewed-by: Cole Robinson <crobinso@redhat.com>
This commit is contained in:
Pino Toscano 2019-04-18 16:08:31 +02:00 committed by Cole Robinson
parent 83f1544d32
commit 4f79c22bf4

View File

@ -264,25 +264,25 @@ class vmmInspection(vmmGObject):
# Inspection applications.
try:
gapps = g.inspect_list_applications(root)
gapps = g.inspect_list_applications2(root)
# applications listing worked, so make apps a real list
# (instead of None)
apps = []
for gapp in gapps:
app = vmmInspectionApplication()
if gapp["app_name"]:
app.name = gapp["app_name"]
if gapp["app_display_name"]:
app.display_name = gapp["app_display_name"]
app.epoch = gapp["app_epoch"]
if gapp["app_version"]:
app.version = gapp["app_version"]
if gapp["app_release"]:
app.release = gapp["app_release"]
if gapp["app_summary"]:
app.summary = gapp["app_summary"]
if gapp["app_description"]:
app.description = gapp["app_description"]
if gapp["app2_name"]:
app.name = gapp["app2_name"]
if gapp["app2_display_name"]:
app.display_name = gapp["app2_display_name"]
app.epoch = gapp["app2_epoch"]
if gapp["app2_version"]:
app.version = gapp["app2_version"]
if gapp["app2_release"]:
app.release = gapp["app2_release"]
if gapp["app2_summary"]:
app.summary = gapp["app2_summary"]
if gapp["app2_description"]:
app.description = gapp["app2_description"]
apps.append(app)
except Exception:
logging.exception("%s: exception while listing apps (ignored)",