From 10990f582a97c1df107f7c4f67c886c6322b7775 Mon Sep 17 00:00:00 2001 From: Charles Arnold Date: Thu, 29 Mar 2018 15:14:21 +0000 Subject: [PATCH] - Fallback to latest version of openSUSE when opensuse-unknown is detected for the ISO (bsc#1085757) virtinst-use-latest-opensuse-version-when-unknown-media.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/virt-manager?expand=0&rev=419 --- virt-manager.changes | 7 ++++ virt-manager.spec | 2 + virtinst-python2-to-python3-conversion.patch | 2 +- ...-opensuse-version-when-unknown-media.patch | 41 +++++++++++++++++++ 4 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 virtinst-use-latest-opensuse-version-when-unknown-media.patch diff --git a/virt-manager.changes b/virt-manager.changes index 57499f17..77affb43 100644 --- a/virt-manager.changes +++ b/virt-manager.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Thu Mar 29 09:06:00 MDT 2018 - carnold@suse.com + +- Fallback to latest version of openSUSE when opensuse-unknown is + detected for the ISO (bsc#1085757) + virtinst-use-latest-opensuse-version-when-unknown-media.patch + ------------------------------------------------------------------- Thu Mar 22 15:35:57 MDT 2018 - carnold@suse.com diff --git a/virt-manager.spec b/virt-manager.spec index 357c7f65..478504f4 100644 --- a/virt-manager.spec +++ b/virt-manager.spec @@ -85,6 +85,7 @@ Patch169: virtinst-keep-install-iso-attached.patch Patch170: virtinst-osdict-get_supported.patch Patch171: virtinst-dont-use-special-copy-cpu-features.patch Patch172: virtinst-dont-set-cpu-model-when-caps-mismatch.patch +Patch173: virtinst-use-latest-opensuse-version-when-unknown-media.patch # Python2 to Python3 patches Patch200: virtmisc-python2-to-python3-conversion.patch Patch201: virtcli-python2-to-python3-conversion.patch @@ -227,6 +228,7 @@ machine). %patch170 -p1 %patch171 -p1 %patch172 -p1 +%patch173 -p1 # Python2 to Python3 patches %patch200 -p1 %patch201 -p1 diff --git a/virtinst-python2-to-python3-conversion.patch b/virtinst-python2-to-python3-conversion.patch index 11cbe16a..19a15a0c 100644 --- a/virtinst-python2-to-python3-conversion.patch +++ b/virtinst-python2-to-python3-conversion.patch @@ -92,7 +92,7 @@ Index: virt-manager-1.5.0/virtinst/osdict.py sorted_distro_list.sort() sortpref.reverse() for prefer in sortpref: -@@ -258,7 +258,7 @@ class _OSDB(object): +@@ -264,7 +264,7 @@ class _OSDB(object): """ sortmap = {} diff --git a/virtinst-use-latest-opensuse-version-when-unknown-media.patch b/virtinst-use-latest-opensuse-version-when-unknown-media.patch new file mode 100644 index 00000000..3a6f881f --- /dev/null +++ b/virtinst-use-latest-opensuse-version-when-unknown-media.patch @@ -0,0 +1,41 @@ +References: bsc#1085757 + +When a version openSUSE is under development, the lookup fails to +detect the version of openSUSE ISO media (it changes with every build). +When 'opensuse-unknown' is detected, look up the most current version +of openSUSE and default to that. This is the same way fedora does it. + +Index: virt-manager-1.5.0/virtinst/osdict.py +=================================================================== +--- virt-manager-1.5.0.orig/virtinst/osdict.py ++++ virt-manager-1.5.0/virtinst/osdict.py +@@ -241,6 +241,12 @@ class _OSDB(object): + "Converting that to the latest fedora OS version=%s", + location, osname) + ++ if osname == "opensuse-unknown": ++ osname = self.latest_opensuse_version() ++ logging.debug("Detected location=%s as os=opensuse-unknown. " ++ "Converting that to the latest opensuse OS version=%s", ++ location, osname) ++ + return osname + + def list_types(self): +@@ -275,6 +281,16 @@ class _OSDB(object): + # First fedora* occurrence should be the newest + return osinfo.name + ++ def latest_opensuse_version(self): ++ os_info = None ++ for osinfo in self.list_os(): ++ if (osinfo.name.startswith("opensuse") and ++ "unknown" not in osinfo.name and ++ "tumbleweed" not in osinfo.name and ++ "factory" not in osinfo.name and ++ "42" not in osinfo.name): ++ # openSUSE Leap 42 is not the latest anymore ++ return osinfo.name + + ##################### + # OsVariant classes #