summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2002-12-18 22:59:41 +0000
committerJeremy Katz <katzj@redhat.com>2002-12-18 22:59:41 +0000
commit092772dad4d39f12d050575e3eeb72076fad1b22 (patch)
treed9c42b642ffacc031970d2f66459fba897662524
parentb8c85a7174a752b485182fa82e3996ac249fcc4c (diff)
downloadanaconda-092772dad4d39f12d050575e3eeb72076fad1b22.tar.gz
anaconda-092772dad4d39f12d050575e3eeb72076fad1b22.tar.xz
anaconda-092772dad4d39f12d050575e3eeb72076fad1b22.zip
fix ejecting -- add a makeDevice param for ejectCdrom (defaults to old
behavior) so that we cna pass just the file we want to eject (eg /tmp/cdrom
-rw-r--r--image.py4
-rw-r--r--isys/isys.py13
2 files changed, 10 insertions, 7 deletions
diff --git a/image.py b/image.py
index d3e878a29..980bc3c9b 100644
--- a/image.py
+++ b/image.py
@@ -73,9 +73,7 @@ class CdromInstallMethod(ImageInstallMethod):
% ("/mnt/source",))
def ejectCD(self):
- if len(self.currentDisc) > 0:
- self.unmountCD()
- isys.ejectCdrom("/tmp/cdrom")
+ isys.ejectCdrom("/tmp/cdrom", makeDevice = 0)
def systemUnmounted(self):
if self.loopbackFile:
diff --git a/isys/isys.py b/isys/isys.py
index 167e18564..546ac10b7 100644
--- a/isys/isys.py
+++ b/isys/isys.py
@@ -413,9 +413,12 @@ def ext2HasJournal(device, makeDevNode = 1):
hasjournal = _isys.e2hasjournal(device);
return hasjournal
-def ejectCdrom(device):
- makeDevInode(device, "/tmp/cdrom")
- fd = os.open("/tmp/cdrom", os.O_RDONLY)
+def ejectCdrom(device, makeDevice = 1):
+ if makeDevice:
+ makeDevInode(device, "/tmp/cdrom")
+ fd = os.open("/tmp/cdrom", os.O_RDONLY)
+ else:
+ fd = os.open(device, os.O_RDONLY)
# this is a best effort
try:
@@ -424,7 +427,9 @@ def ejectCdrom(device):
pass
os.close(fd)
- os.unlink("/tmp/cdrom")
+
+ if makeDevice:
+ os.unlink("/tmp/cdrom")
def driveIsRemovable(device):
# assume ide if starts with 'hd', and we don't have to create