[virt-tools-list] [virt-manager PATCH] Support incomplete .treeinfo files

Martin Kletzander mkletzan at redhat.com
Mon Apr 22 14:58:22 UTC 2013


In case there was '.treeinfo' file available, virt-install was
forcibly getting image information out of the file.  For some
distributions (especially older releases, e.g. RHEL 4), there might be
'.treeinfo' file available, but with incomplete information.  Allow
fallback to default values even when '.treeinfo' file is found.

Resolves: https://bugzilla.redhat.com/show_bug.cgi?id=954262

Signed-off-by: Martin Kletzander <mkletzan at redhat.com>
---
 virtinst/OSDistro.py | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/virtinst/OSDistro.py b/virtinst/OSDistro.py
index f88874b..5ecfdf6 100644
--- a/virtinst/OSDistro.py
+++ b/virtinst/OSDistro.py
@@ -1,7 +1,7 @@
 #
 # Represents OS distribution specific install data
 #
-# Copyright 2006-2007  Red Hat, Inc.
+# Copyright 2006-2007, 2013  Red Hat, Inc.
 # Daniel P. Berrange <berrange at redhat.com>
 #
 # This program is free software; you can redistribute it and/or modify
@@ -268,9 +268,13 @@ class Distro:
         kernelpath = None
         initrdpath = None
         if self._hasTreeinfo(fetcher, progresscb):
-            kernelpath = self._getTreeinfoMedia("kernel")
-            initrdpath = self._getTreeinfoMedia("initrd")
-        else:
+            try:
+                kernelpath = self._getTreeinfoMedia("kernel")
+                initrdpath = self._getTreeinfoMedia("initrd")
+            except ConfigParser.NoSectionError:
+                pass
+
+        if not kernelpath or not initrdpath:
             # fall back to old code
             if self.type is None or self.type == "hvm":
                 paths = self._hvm_kernel_paths
-- 
1.8.2.1




More information about the virt-tools-list mailing list