diff --git a/tests/utils.py b/tests/utils.py index 977b9137f..e6ca5cead 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -149,12 +149,15 @@ def get_basic_paravirt_guest(installer=None): g.memory = int(200) g.maxmemory = int(400) g.uuid = "12345678-1234-1234-1234-123456789012" - g.boot = ["/boot/vmlinuz", "/boot/initrd"] g.add_device(VirtualGraphics("vnc", keymap="ja")) g.vcpus = 5 if installer: g.installer = installer + else: + instboot = getattr(g.installer, "_install_bootconfig") + instboot.kernel = "/boot/vmlinuz" + instboot.initrd = "/boot/initrd" g.installer._scratchdir = scratch return g diff --git a/tests/validation.py b/tests/validation.py index c40d40331..7440f8be5 100644 --- a/tests/validation.py +++ b/tests/validation.py @@ -150,12 +150,6 @@ args = { 'installer' : { 'init_conns' : [ testconn, None ], - 'boot' : { - 'invalid' : ['', 0, ('1element'), ['1el', '2el', '3el'], - {'1element': '1val'}, - {'kernel' : 'a', 'wronglabel' : 'b'}], - 'valid' : [('kern', 'init'), ['kern', 'init'], - { 'kernel' : 'a', 'initrd' : 'b'}]}, 'extraargs' : { 'invalid' : [], 'valid' : ['someargs']}, diff --git a/virtinst/DistroInstaller.py b/virtinst/DistroInstaller.py index f02fb2205..e517bed33 100644 --- a/virtinst/DistroInstaller.py +++ b/virtinst/DistroInstaller.py @@ -154,10 +154,10 @@ def _upload_file(conn, meter, destpool, src): class DistroInstaller(Installer.Installer): - def __init__(self, type="xen", location=None, boot=None, + def __init__(self, type="xen", location=None, extraargs=None, os_type=None, conn=None, caps=None): - Installer.Installer.__init__(self, type, location, boot, extraargs, + Installer.Installer.__init__(self, type, location, extraargs, os_type, conn=conn, caps=caps) self._livecd = False diff --git a/virtinst/Guest.py b/virtinst/Guest.py index 935dff0b8..584dd981f 100644 --- a/virtinst/Guest.py +++ b/virtinst/Guest.py @@ -535,13 +535,6 @@ class Guest(XMLBuilderDomain.XMLBuilderDomain): return self._installer.scratchdir scratchdir = property(get_scratchdir) - # Deprecated: Should be called from the installer directly - def get_boot(self): - return self._installer.boot - def set_boot(self, val): - self._installer.boot = val - boot = property(get_boot, set_boot) - # Deprecated: Should be called from the installer directly def get_extraargs(self): return self._installer.extraargs diff --git a/virtinst/Installer.py b/virtinst/Installer.py index c235b67cc..d6bd690fd 100644 --- a/virtinst/Installer.py +++ b/virtinst/Installer.py @@ -80,7 +80,7 @@ class Installer(XMLBuilderDomain.XMLBuilderDomain): """ _dumpxml_xpath = "/domain/os" - def __init__(self, type="xen", location=None, boot=None, + def __init__(self, type="xen", location=None, extraargs=None, os_type=None, conn=None, parsexml=None, parsexmlnode=None, caps=None): XMLBuilderDomain.XMLBuilderDomain.__init__(self, conn, parsexml, @@ -121,8 +121,6 @@ class Installer(XMLBuilderDomain.XMLBuilderDomain): if not location is None: self.location = location - if not boot is None: - self.boot = boot self.extraargs = extraargs self._tmpfiles = [] @@ -218,38 +216,6 @@ class Installer(XMLBuilderDomain.XMLBuilderDomain): self._initrd_injections = val initrd_injections = property(get_initrd_injections, set_initrd_injections) - # kernel + initrd pair to use for installing as opposed to using a location - def get_boot(self): - return {"kernel" : self._install_bootconfig.kernel, - "initrd" : self._install_bootconfig.initrd} - def set_boot(self, val): - self.cdrom = False - boot = {} - if type(val) == tuple: - if len(val) != 2: - raise ValueError(_("Must pass both a kernel and initrd")) - (k, i) = val - boot = {"kernel": k, "initrd": i} - - elif type(val) == dict: - if "kernel" not in val or "initrd" not in val: - raise ValueError(_("Must pass both a kernel and initrd")) - boot = val - - elif type(val) == list: - if len(val) != 2: - raise ValueError(_("Must pass both a kernel and initrd")) - boot = {"kernel": val[0], "initrd": val[1]} - - else: - raise ValueError(_("Kernel and initrd must be specified by " - "a list, dict, or tuple.")) - - self._install_bootconfig.kernel = boot.get("kernel") - self._install_bootconfig.initrd = boot.get("initrd") - - boot = property(get_boot, set_boot) - # extra arguments to pass to the guest installer def get_extra_args(self): return self._install_bootconfig.kernel_args