[virt-tools-list] [PATCH 2/3] virtinst: Get rid of the s390x-specific cd detection function

Viktor Mihajlovski mihajlov at linux.vnet.ibm.com
Mon Sep 11 15:19:35 UTC 2017


Move the s390x-specific code into the generic cd detection function.

Signed-off-by: Viktor Mihajlovski <mihajlov at linux.vnet.ibm.com>
---
 virtinst/urlfetcher.py | 25 ++++---------------------
 1 file changed, 4 insertions(+), 21 deletions(-)

diff --git a/virtinst/urlfetcher.py b/virtinst/urlfetcher.py
index e657def..a32c2d6 100644
--- a/virtinst/urlfetcher.py
+++ b/virtinst/urlfetcher.py
@@ -1267,33 +1267,16 @@ class UbuntuDistro(DebianDistro):
         if not self._check_info(".disk/info"):
             return False
 
-        kernel_initrd_pair = ("linux", "initrd.gz")
+        if not self.arch == "s390x":
+            kernel_initrd_pair = ("linux", "initrd.gz")
+        else:
+            kernel_initrd_pair = ("boot/kernel.ubuntu", "boot/initrd.ubuntu")
 
         self._hvm_kernel_paths += [kernel_initrd_pair]
         self._xen_kernel_paths += [kernel_initrd_pair]
 
         return True
 
-    def _is_install_cd_s390x(self):
-        # For install CDs (s390x)
-        if not self.arch == "s390x":
-            return False
-
-        if not self._check_info(".disk/info"):
-            return False
-
-        self._hvm_kernel_paths += [("boot/kernel.ubuntu", "boot/initrd.ubuntu")]
-        self._xen_kernel_paths += [("boot/kernel.ubuntu", "boot/initrd.ubuntu")]
-
-        return True
-
-    def isValidStore(self):
-        return any(check() for check in [
-            self._is_regular_tree,
-            self._is_tree_iso,
-            self._is_install_cd,
-            self._is_install_cd_s390x,
-            ])
 
 
 class MandrivaDistro(Distro):
-- 
1.9.1




More information about the virt-tools-list mailing list