Fix windows media detection

OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=253
This commit is contained in:
Charles Arnold 2015-09-04 14:36:51 +00:00 committed by Git OBS Bridge
parent a67df0f6e9
commit f84708fe49
2 changed files with 45 additions and 7 deletions

View File

@ -1,7 +1,7 @@
#
# spec file for package virt-manager
#
# Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany.
# Copyright (c) 2015 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@ -15,7 +15,6 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%define with_guestfs 0
%define askpass_package "openssh-askpass"
%define qemu_user "qemu"
@ -99,6 +98,7 @@ Requires: virt-manager-common = %{verrel}
Requires: vm-install >= 0.5.6
# Typelib's
Recommends: typelib(AppIndicator3)
Requires: typelib(GVnc)
Requires: typelib(GtkVnc)
Requires: typelib(LibvirtGLib)
@ -116,7 +116,7 @@ Requires: python-libguestfs
%endif
BuildRequires: glib2-devel
%if 0%{?suse_version} >= 1315
%if 0%{?suse_version} > 1315
BuildRequires: gobject-introspection
%endif
BuildRequires: intltool

View File

@ -1,10 +1,10 @@
Enhancement to detect windows media. It is based solely upon
finding an autorun.inf file in the root of the installation source.
It only assumes windows, not the specific version of windows.
Index: virt-manager-1.2.0/virtinst/urlfetcher.py
Index: virt-manager-1.2.1/virtinst/urlfetcher.py
===================================================================
--- virt-manager-1.2.0.orig/virtinst/urlfetcher.py
+++ virt-manager-1.2.0/virtinst/urlfetcher.py
--- virt-manager-1.2.1.orig/virtinst/urlfetcher.py
+++ virt-manager-1.2.1/virtinst/urlfetcher.py
@@ -408,6 +408,24 @@ def _distroFromSUSEContent(fetcher, arch
return ob
@ -48,10 +48,48 @@ Index: virt-manager-1.2.0/virtinst/urlfetcher.py
+class WindowsDistro(Distro):
+
+ urldistro = "windows"
+ os_variant = "win8.1"
+ os_variant = "win2k12r2"
+
+ def isValidStore(self):
+ return False
# Build list of all *Distro classes
def _build_distro_list():
Index: virt-manager-1.2.1/virtinst/distroinstaller.py
===================================================================
--- virt-manager-1.2.1.orig/virtinst/distroinstaller.py
+++ virt-manager-1.2.1/virtinst/distroinstaller.py
@@ -499,21 +499,25 @@ class DistroInstaller(Installer):
def detect_distro(self, guest):
distro = None
+ def _get_distro(guest):
+ try:
+ fetcher = self._get_fetcher(guest, None)
+ fetcher.prepareLocation()
+
+ store = self._get_store(guest, fetcher)
+ return store.get_osdict_info()
+ finally:
+ fetcher.cleanupLocation()
try:
if _is_url(self.conn, self.location):
- try:
- fetcher = self._get_fetcher(guest, None)
- fetcher.prepareLocation()
-
- store = self._get_store(guest, fetcher)
- distro = store.get_osdict_info()
- finally:
- fetcher.cleanupLocation()
+ distro = _get_distro(guest)
elif self.conn.is_remote():
logging.debug("Can't detect distro for media on "
"remote connection.")
else:
distro = OSDB.lookup_os_by_media(self.location)
+ if distro is None:
+ distro = _get_distro(guest)
except:
logging.debug("Error attempting to detect distro.", exc_info=True)