[et-mgmt-tools] Invalid .treeinfo file causes an exception
Cole Robinson
crobinso at redhat.com
Mon Jun 29 15:09:46 UTC 2009
David Robinson wrote:
> Hi all,
>
> I tried to install a VM from a tree that had an empty .treeinfo file
> (not sure why/how it got there) and got the exception below.
>
> Traceback (most recent call last):
> File "/usr/sbin/virt-install", line 780, in <module>
> main()
> File "/usr/sbin/virt-install", line 678, in main
> start_time, guest.start_install)
> File "/usr/sbin/virt-install", line 733, in do_install
> dom = install_func(conscb, progresscb, wait=(not wait))
> File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 539,
> in start_install
> self._prepare_install(meter)
> File "/usr/lib/python2.6/site-packages/virtinst/Guest.py", line 594,
> in _prepare_install
> meter = meter)
> File "/usr/lib/python2.6/site-packages/virtinst/DistroInstaller.py",
> line 233, in prepare
> self._prepare_kernel_and_initrd(guest, distro, meter)
> File "/usr/lib/python2.6/site-packages/virtinst/DistroInstaller.py",
> line 182, in _prepare_kernel_and_initrd
> type=self.os_type, distro=distro)
> File "/usr/lib/python2.6/site-packages/virtinst/OSDistro.py", line
> 133, in acquireKernel
> scratchdir, type, distro)
> File "/usr/lib/python2.6/site-packages/virtinst/OSDistro.py", line
> 114, in _acquireMedia
> scratchdir=scratchdir, arch=arch)
> File "/usr/lib/python2.6/site-packages/virtinst/OSDistro.py", line
> 60, in _storeForDistro
> arch, typ, scratchdir)
> File "/usr/lib/python2.6/site-packages/virtinst/OSDistro.py", line
> 163, in distroFromTreeinfo
> fam = treeinfo.get("general", "family")
> File "/usr/lib64/python2.6/ConfigParser.py", line 531, in get
> raise NoSectionError(section)
> NoSectionError: No section: 'general'
>
> Removing the file fixed the problem, but the patch below (hasn't been
> tested) would also fix it.
>
> --- /usr/lib/python2.6/site-packages/virtinst/OSDistro.py.orig 2009-06-26
> 13:45:30.109607052 +0100
> +++ /usr/lib/python2.6/site-packages/virtinst/OSDistro.py 2009-06-26
> 13:47:58.655642976 +0100
> @@ -160,7 +160,10 @@
> finally:
> os.unlink(tmptreeinfo)
>
> - fam = treeinfo.get("general", "family")
> + try:
> + fam = treeinfo.get("general", "family")
> + except NoSectionError:
> + return None
>
> if re.match(".*Fedora.*", fam):
> dclass = FedoraDistro
>
> # rpm -qf /usr/lib/python2.6/site-packages/virtinst/OSDistro.py
> python-virtinst-0.400.3-8.fc11.noarch
>
> --Dave
>
Thanks for the report! Pushed now:
http://hg.et.redhat.com/cgi-bin/hg-virt.cgi/applications/virtinst--devel/rev/bb8d3a5bb858
- Cole
More information about the et-mgmt-tools
mailing list