[virt-tools-list] [virt-manager PATCH 4/6] inspection: save the package format

Pino Toscano ptoscano at redhat.com
Wed Apr 17 16:49:51 UTC 2019


Save the package format of a guest as part of its inspection data, so
later on it can be used to tweak other results (like the version of
installed packages).
---
 virtManager/domain.py     | 1 +
 virtManager/inspection.py | 6 ++++--
 2 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/virtManager/domain.py b/virtManager/domain.py
index f4f03c7a..cb15b77f 100644
--- a/virtManager/domain.py
+++ b/virtManager/domain.py
@@ -79,6 +79,7 @@ class vmmInspectionData(object):
         self.icon = None
         self.applications = None
         self.errorstr = None
+        self.package_format = None
 
 
 class vmmDomainSnapshot(vmmLibvirtObject):
diff --git a/virtManager/inspection.py b/virtManager/inspection.py
index 005b410c..15e29119 100644
--- a/virtManager/inspection.py
+++ b/virtManager/inspection.py
@@ -229,6 +229,7 @@ class vmmInspection(vmmGObject):
         hostname = g.inspect_get_hostname(root)  # string
         product_name = g.inspect_get_product_name(root)  # string
         product_variant = g.inspect_get_product_variant(root)  # string
+        package_format = g.inspect_get_package_format(root)  # string
 
         # For inspect_list_applications and inspect_get_icon we
         # require that the guest filesystems are mounted.  However
@@ -273,9 +274,9 @@ class vmmInspection(vmmGObject):
         del g
 
         # Log what we found.
-        logging.debug("%s: detected operating system: %s %s %d.%d (%s)",
+        logging.debug("%s: detected operating system: %s %s %d.%d (%s) (%s)",
                       prettyvm, os_type, distro, major_version, minor_version,
-                      product_name)
+                      product_name, package_format)
         logging.debug("hostname: %s", hostname)
         if icon:
             logging.debug("icon: %d bytes", len(icon))
@@ -292,5 +293,6 @@ class vmmInspection(vmmGObject):
         data.product_variant = str(product_variant)
         data.icon = icon
         data.applications = list(apps or [])
+        data.package_format = str(package_format)
 
         return data
-- 
2.20.1




More information about the virt-tools-list mailing list