mirror of
https://github.com/virt-manager/virt-manager.git
synced 2025-02-25 18:55:27 -06:00
virtinst: install: simplify has_install_phase()
This commit is contained in:
@@ -32,7 +32,11 @@ class ImageInstallerException(Exception):
|
||||
|
||||
|
||||
class ImageInstaller(Installer.Installer):
|
||||
"""Installer for image-based guests"""
|
||||
"""
|
||||
Installer for virt-image-based guests
|
||||
"""
|
||||
_has_install_phase = False
|
||||
|
||||
def __init__(self, image, capabilities=None, boot_index=None, conn=None):
|
||||
Installer.Installer.__init__(self, conn=conn, caps=capabilities)
|
||||
|
||||
@@ -102,9 +106,6 @@ class ImageInstaller(Installer.Installer):
|
||||
self.bootconfig.initrd = self.boot_caps.initrd
|
||||
self.bootconfig.kernel_args = self.boot_caps.cmdline
|
||||
|
||||
def has_install_phase(self):
|
||||
return False
|
||||
|
||||
# Private methods
|
||||
def _get_bootdev(self, isinstall, guest):
|
||||
return self.boot_caps.bootdev
|
||||
|
||||
@@ -30,14 +30,12 @@ class ImportInstaller(Installer.Installer):
|
||||
attached to the Guest (so, one of 'hd', 'cdrom', or 'fd'). All the
|
||||
user has to do is fill in the Guest object with the desired parameters.
|
||||
"""
|
||||
_has_install_phase = False
|
||||
|
||||
# General Installer methods
|
||||
def prepare(self, guest, meter):
|
||||
pass
|
||||
|
||||
def has_install_phase(self):
|
||||
return False
|
||||
|
||||
# Private methods
|
||||
def _get_bootdev(self, isinstall, guest):
|
||||
disks = guest.get_devices("disk")
|
||||
|
||||
@@ -75,8 +75,9 @@ class Installer(XMLBuilderDomain.XMLBuilderDomain):
|
||||
- Hypervisor name (parameter 'type') ('qemu', 'kvm', 'xen', etc.)
|
||||
- Guest architecture ('i686', 'x86_64')
|
||||
"""
|
||||
|
||||
_dumpxml_xpath = "/domain/os"
|
||||
_has_install_phase = True
|
||||
|
||||
def __init__(self, type="xen", location=None,
|
||||
extraargs=None, os_type=None, conn=None,
|
||||
parsexml=None, parsexmlnode=None, caps=None):
|
||||
@@ -380,7 +381,7 @@ class Installer(XMLBuilderDomain.XMLBuilderDomain):
|
||||
into the guest. Things like LiveCDs, Import, or a manually specified
|
||||
bootorder do not have an install phase.
|
||||
"""
|
||||
return True
|
||||
return self._has_install_phase
|
||||
|
||||
def cleanup(self):
|
||||
"""
|
||||
@@ -448,6 +449,8 @@ class Installer(XMLBuilderDomain.XMLBuilderDomain):
|
||||
|
||||
|
||||
class ContainerInstaller(Installer):
|
||||
_has_install_phase = False
|
||||
|
||||
def prepare(self, guest, meter):
|
||||
ignore = guest
|
||||
ignore = meter
|
||||
@@ -456,6 +459,3 @@ class ContainerInstaller(Installer):
|
||||
ignore = isinstall
|
||||
ignore = guest
|
||||
return self.bootconfig.BOOT_DEVICE_HARDDISK
|
||||
|
||||
def has_install_phase(self):
|
||||
return False
|
||||
|
||||
@@ -29,6 +29,7 @@ class LiveCDInstallerException(Exception):
|
||||
|
||||
|
||||
class LiveCDInstaller(Installer.Installer):
|
||||
_has_install_phase = False
|
||||
|
||||
# LiveCD specific methods/overwrites
|
||||
def _validate_location(self, val):
|
||||
@@ -68,9 +69,6 @@ class LiveCDInstaller(Installer.Installer):
|
||||
|
||||
self.install_devices.append(disk)
|
||||
|
||||
def has_install_phase(self):
|
||||
return False
|
||||
|
||||
# Internal methods
|
||||
def _get_bootdev(self, isinstall, guest):
|
||||
return self.bootconfig.BOOT_DEVICE_CDROM
|
||||
|
||||
Reference in New Issue
Block a user