[virt-tools-list] [PATCH] osdict, libosinfo: use "minimum" resources when "recommended" is missing

Giuseppe Scrivano gscrivan at redhat.com
Fri Sep 12 08:52:19 UTC 2014


Some OS entries in libosinfo miss the "recommended" resources block.
In this case use the "minimum" resources when available.

Signed-off-by: Giuseppe Scrivano <gscrivan at redhat.com>
---
 virtinst/osdict.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/virtinst/osdict.py b/virtinst/osdict.py
index 9e48270..88010ad 100644
--- a/virtinst/osdict.py
+++ b/virtinst/osdict.py
@@ -446,6 +446,11 @@ class _OsVariant(_OsVariantType):
                     ret["storage"] = r.get_storage()
                     break
 
+        # libosinfo may miss the recommended resources block for some OS,
+        # in this case read first the minimum resources (if present)
+        # and use them.
+        read_resource(self._os.get_minimum_resources(), "all")
+        read_resource(self._os.get_minimum_resources(), arch)
         read_resource(self._os.get_recommended_resources(), "all")
         read_resource(self._os.get_recommended_resources(), arch)
 
-- 
1.9.3




More information about the virt-tools-list mailing list