[virt-manager PATCH] Support incomplete .treeinfo files

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
 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@xxxxxxxxxx>
 #
 # 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

_______________________________________________
virt-tools-list mailing list
virt-tools-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/virt-tools-list




[Index of Archives]     [Linux Virtualization]     [KVM Development]     [CentOS Virtualization]     [Netdev]     [Ethernet Bridging]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Bugtraq]     [Yosemite Forum]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux Admin]     [Samba]     [Video 4 Linux]

  Powered by Linux