[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[f17 master] don't eject the dvd from anaconda (#787461)



From: "Brian C. Lane" <bcl redhat com>

Now that we are running from the squashfs.img on the install media
we cannot eject it until shutdown. This removes ejecting from anaconda
which really isn't needed during the install since we no longer support
split media.

We still need to solve the problem of ejecting the media on shutdown
for those users who need it, but that needs to happen outside of
anaconda now.
---
 anaconda                    |    8 --------
 pyanaconda/installmethod.py |   17 -----------------
 pyanaconda/yuminstall.py    |   34 +++++++++-------------------------
 3 files changed, 9 insertions(+), 50 deletions(-)

diff --git a/anaconda b/anaconda
index 8d34f38..9fa49ba 100755
--- a/anaconda
+++ b/anaconda
@@ -63,14 +63,6 @@ def exitHandler(anaconda, exitCode=None):
     if anaconda.ksdata and not flags.imageInstall:
         from pykickstart.constants import KS_SHUTDOWN, KS_WAIT, KS_REBOOT
 
-        if anaconda.ksdata.reboot.eject:
-            for drive in anaconda.storage.devicetree.devices:
-                if drive.type != "cdrom":
-                    continue
-
-                log.info("attempting to eject %s" % drive.path)
-                drive.eject()
-
         if anaconda.ksdata.reboot.action == KS_SHUTDOWN:
             os.system("systemctl --force --no-wall poweroff")
         elif anaconda.ksdata.reboot.action == KS_WAIT:
diff --git a/pyanaconda/installmethod.py b/pyanaconda/installmethod.py
index e96c54d..0f3d9e5 100644
--- a/pyanaconda/installmethod.py
+++ b/pyanaconda/installmethod.py
@@ -27,21 +27,4 @@ log = logging.getLogger("anaconda")
 import isys, product
 
 def doMethodComplete(anaconda):
-    def _ejectDevice():
-        # Ejecting the CD/DVD for kickstart is handled only after %post scripts
-        # have been run.
-        if anaconda.ksdata:
-            return None
-
-        if anaconda.mediaDevice:
-            return anaconda.storage.devicetree.getDeviceByName(anaconda.mediaDevice)
-
-        # If we booted off the boot.iso instead of disc 1, eject that as well.
-        if anaconda.stage2 and anaconda.stage2.startswith("cdrom://"):
-            dev = anaconda.stage2[8:].split(':')[0]
-            return anaconda.storage.devicetree.getDeviceByName(dev)
-
     anaconda.backend.complete(anaconda)
-    dev = _ejectDevice()
-    if dev:
-        dev.eject()
diff --git a/pyanaconda/yuminstall.py b/pyanaconda/yuminstall.py
index cd78d72..196229e 100644
--- a/pyanaconda/yuminstall.py
+++ b/pyanaconda/yuminstall.py
@@ -396,33 +396,17 @@ class AnacondaYum(yum.YumBase):
             if verifyMedia(self.tree, None):
                 return
 
-            dev.format.unmount()
+        dev.format.unmount()
 
-        dev.eject()
+        log.error("Wrong disc found on %s" % (self.tree))
+        if self.anaconda.intf:
+            self.anaconda.intf.beep()
 
-        while True:
-            if self.anaconda.intf:
-                self.anaconda.intf.beep()
-
-            self.anaconda.intf.messageWindow(_("Change Disc"),
-                _("Please insert the %(productName)s disc to continue.")
-                % {'productName': productName})
-
-            try:
-                dev.format.mount()
-
-                if verifyMedia(self.tree, self._timestamp):
-                    break
-
-                self.anaconda.intf.messageWindow(_("Wrong Disc"),
-                        _("That's not the correct %s disc.")
-                          % (productName,))
-
-                dev.format.unmount()
-                dev.eject()
-            except Exception:
-                self.anaconda.intf.messageWindow(_("Error"),
-                        _("Unable to access the disc."))
+            self.messageWindow(_("Wrong Disc"),
+                _("That's not the correct %s disc.") % (productName),
+                type="custom", custom_icon="error",
+                custom_buttons=[_("_Exit installer")])
+        sys.exit(1)
 
     def _mountInstallImage(self):
         umountImage(self.tree)
-- 
1.7.7.6


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]