def setDispatch(self):
self.dispatch = dispatch.Dispatcher(self)
@@ -522,7 +525,7 @@ class Anaconda:
def setMethod(self):
if self.methodstr.startswith('cdrom://'):
from image import CdromInstallMethod
- self.method = CdromInstallMethod(self.methodstr, self.rootPath, self.intf)
+ self.method = CdromInstallMethod(self.methodstr, self.rootPath, self.intf, self.noeject)
elif self.methodstr.startswith('nfs:/'):
from image import NfsInstallMethod
self.method = NfsInstallMethod(self.methodstr, self.rootPath, self.intf)
@@ -669,6 +672,9 @@ if __name__ == "__main__":
if opts.virtpconsole:
flags.virtpconsole = opts.virtpconsole
+ if opts.noeject:
+ anaconda.noeject = True
+
# probing for hardware on an s390 seems silly...
if rhpl.getArch() == "s390":
opts.isHeadless = True
diff --git a/image.py b/image.py
index ab689a8..dcdeca5 100644
--- a/image.py
+++ b/image.py
@@ -140,7 +140,10 @@ class CdromInstallMethod(ImageInstallMethod):
% ("/mnt/source",))
def ejectCD(self):
- isys.ejectCdrom(self.device, makeDevice=1)
+ if self.noeject:
+ log.info("noeject in effect, not ejecting cdrom")
+ else:
+ isys.ejectCdrom(self.device, makeDevice=1)
def badPackageError(self, pkgname):
return _("The file %s cannot be opened. This is due to a missing "
@@ -257,7 +260,10 @@ class CdromInstallMethod(ImageInstallMethod):
break
if not done:
- isys.ejectCdrom(self.device)
+ if self.noeject:
+ log.info("noeject in effect, not ejecting cdrom")
+ else:
+ isys.ejectCdrom(self.device)
while not done:
if self.intf is not None:
@@ -303,7 +309,10 @@ class CdromInstallMethod(ImageInstallMethod):
_("That's not the correct %s CDROM.")
% (productName,))
isys.umount("/mnt/source")
- isys.ejectCdrom(self.device)
+ if self.noeject:
+ log.info("noeject in effect, not ejecting cdrom")
+ else:
+ isys.ejectCdrom(self.device)
except:
self.messageWindow(_("Error"),
_("Unable to access the CDROM."))
@@ -327,7 +336,7 @@ class CdromInstallMethod(ImageInstallMethod):
except SystemError:
pass