diff --git a/python-virtinst.spec b/python-virtinst.spec index 7552b92..a4ad71e 100644 --- a/python-virtinst.spec +++ b/python-virtinst.spec @@ -17,7 +17,7 @@ Summary: Python modules and utilities for installing virtual machines Name: python-%{appname} Version: 0.400.3 -Release: 11%{_extra_release} +Release: 12%{_extra_release} Source0: http://virt-manager.org/download/sources/%{appname}/%{appname}-%{version}.tar.gz Patch1: %{appname}-%{version}-fix-virtimage-scratch.patch Patch2: %{appname}-%{version}-hostdev-libvirt-calls.patch @@ -49,6 +49,8 @@ Patch15: %{appname}-%{version}-sasl-auth.patch Patch16: %{appname}-%{version}-windows-acpi.patch # Add CLI tests Patch17: %{appname}-%{version}-add-cli-test.patch +# Ensure unknown OS detection doesn't break the install +Patch18: %{appname}-%{version}-safe-os-detect.patch License: GPLv2+ Group: Development/Libraries @@ -93,6 +95,7 @@ and install new VMs) and virt-clone (clone an existing virtual machine). %patch15 -p1 %patch16 -p1 %patch17 -p1 +%patch18 -p1 %build python setup.py build @@ -128,6 +131,9 @@ rm -rf $RPM_BUILD_ROOT %{_bindir}/virt-convert %changelog +* Thu Oct 22 2009 Cole Robinson - 0.400.3-12.fc11 +- Ensure unknown OS detection doesn't break the install + * Mon Oct 05 2009 Cole Robinson - 0.400.3-11.fc11 - Allow SASL auth (bz 484099) - Use ACPI for windows on KVM (bz 479977) diff --git a/virtinst-0.400.3-safe-os-detect.patch b/virtinst-0.400.3-safe-os-detect.patch new file mode 100644 index 0000000..148d72c --- /dev/null +++ b/virtinst-0.400.3-safe-os-detect.patch @@ -0,0 +1,70 @@ +# HG changeset patch +# User Cole Robinson +# Date 1241726968 14400 +# Node ID db997572bdc8a8fc4c567fbf165f853167dfa462 +# Parent 9768e52d4d624f83853f7f23f85402c8a078eb6f +Make sure autodetected OS type/variant are in the osdict. + +If not, log a message and set the values to None, rather than barf later +down the line. + +diff -r 9768e52d4d62 -r db997572bdc8 virtinst/OSDistro.py +--- a/virtinst/OSDistro.py Thu May 07 15:50:06 2009 -0400 ++++ b/virtinst/OSDistro.py Thu May 07 16:09:28 2009 -0400 +@@ -28,6 +28,7 @@ + import ConfigParser + + import virtinst ++from virtinst.Guest import Guest + from virtinst import _util + from virtinst import _virtinst as _ + +@@ -118,8 +119,9 @@ + if iskernel is True: + # FIXME: We should probably do this for both kernel and boot + # disk? ++ os_type, os_variant = store.get_osdict_info() + return (store.acquireKernel(guest, fetcher, progresscb), +- store.os_type, store.os_variant) ++ os_type, os_variant) + elif iskernel is False: + return store.acquireBootDisk(fetcher, progresscb) + else: +@@ -145,7 +147,7 @@ + import urlgrabber + progress = urlgrabber.progress.BaseMeter() + store = _acquireMedia(None, None, location, progress, arch, "/var/tmp") +- return (store.os_type, store.os_variant) ++ return store.get_osdict_info() + + + def distroFromTreeinfo(fetcher, progresscb, uri, arch, vmtype=None, +@@ -246,6 +248,28 @@ + raise RuntimeError(_("Could not find boot.iso in %s tree." % \ + self.name)) + ++ def get_osdict_info(self): ++ """ ++ Return (distro, variant) tuple, checking to make sure they are valid ++ osdict entries ++ """ ++ if not self.os_type: ++ return (None, None) ++ ++ if self.os_type not in Guest.list_os_types(): ++ logging.debug("%s set os_type to %s, which is not in osdict." % ++ (self, self.os_type)) ++ return (None, None) ++ ++ if (self.os_variant and ++ self.os_variant not in Guest.list_os_variants(self.os_type)): ++ logging.debug("%s set os_variant to %s, which is not in osdict" ++ " for distro %s." % ++ (self, self.os_variant, self.os_type)) ++ return (self.os_type, None) ++ ++ return (self.os_type, self.os_variant) ++ + def _hasTreeinfo(self, fetcher, progresscb): + # all Red Hat based distros should have .treeinfo, perhaps others + # will in time