diff --git a/tests/utils.py b/tests/utils.py index 61491fa55..3a75f1b5c 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -281,8 +281,10 @@ def make_distro_installer(location="/dev/default-pool/default-vol"): def make_live_installer(location="/dev/null"): - inst = virtinst.LiveCDInstaller(_conn) + inst = virtinst.DistroInstaller(_conn) inst.location = location + inst.livecd = True + inst.cdrom = True return inst diff --git a/virt-install b/virt-install index 2f8236849..f5dc2e36c 100755 --- a/virt-install +++ b/virt-install @@ -419,14 +419,12 @@ def show_warnings(options, guest): def build_installer(options, conn, virt_type): # Build the Installer instance - if options.livecd: - instclass = virtinst.LiveCDInstaller - elif options.pxe: + if options.pxe: if options.nonetworks: fail(_("Can't use --pxe with --nonetworks")) instclass = virtinst.PXEInstaller - elif options.cdrom or options.location: + elif options.cdrom or options.location or options.livecd: instclass = virtinst.DistroInstaller elif virt_type == "exe": instclass = virtinst.ContainerInstaller @@ -440,9 +438,9 @@ def build_installer(options, conn, virt_type): else: instclass = virtinst.DistroInstaller - # Only set installer params here that impact the hw config, not - # anything to do with install media installer = instclass(conn) + if options.livecd: + installer.livecd = True return installer diff --git a/virtinst/__init__.py b/virtinst/__init__.py index 8c4cc1407..adb4e70e7 100644 --- a/virtinst/__init__.py +++ b/virtinst/__init__.py @@ -65,7 +65,7 @@ from virtinst.devicerng import VirtualRNGDevice from virtinst.devicepanic import VirtualPanicDevice from virtinst.installer import (ContainerInstaller, ImportInstaller, - LiveCDInstaller, PXEInstaller, Installer) + PXEInstaller, Installer) from virtinst.distroinstaller import DistroInstaller diff --git a/virtinst/distroinstaller.py b/virtinst/distroinstaller.py index 6a8f1e098..b8db05976 100644 --- a/virtinst/distroinstaller.py +++ b/virtinst/distroinstaller.py @@ -449,6 +449,9 @@ class DistroInstaller(Installer): # Public installer impls # ########################## + def has_install_phase(self): + return not self.livecd + def scratchdir_required(self): if not self.location: return False diff --git a/virtinst/guest.py b/virtinst/guest.py index c2ab18878..18adc3acc 100644 --- a/virtinst/guest.py +++ b/virtinst/guest.py @@ -322,8 +322,8 @@ class Guest(XMLBuilder): Return the full Guest xml configuration. @param install: Whether we want the 'OS install' configuration or - the 'post-install' configuration. (Some Installers, - like the LiveCDInstaller may not have an 'install' + the 'post-install' configuration. (Some installs, + like an import or livecd may not have an 'install' config.) @type install: C{bool} @param disk_boot: Whether we should boot off the harddisk, regardless diff --git a/virtinst/installer.py b/virtinst/installer.py index 6dbfe6d08..4482ae6fa 100644 --- a/virtinst/installer.py +++ b/virtinst/installer.py @@ -244,20 +244,6 @@ class PXEInstaller(Installer): return bootdev -class LiveCDInstaller(Installer): - _has_install_phase = False - cdrom = True - - def _validate_location(self, val): - return self._make_cdrom_dev(val).path - def _prepare(self, guest, meter): - ignore = guest - ignore = meter - self.install_devices.append(self._make_cdrom_dev(self.location)) - def _get_bootdev(self, isinstall, guest): - return OSXML.BOOT_DEVICE_CDROM - - class ImportInstaller(Installer): _has_install_phase = False