diff options
author | Mike Fulbright <msf@redhat.com> | 2002-08-15 18:59:55 +0000 |
---|---|---|
committer | Mike Fulbright <msf@redhat.com> | 2002-08-15 18:59:55 +0000 |
commit | ec013936e1ff34f039bc9ed4666ca51c7b2b367a (patch) | |
tree | b8b8416bf12985a0772b94a40ef03eaa92219e7b | |
parent | 002d4b51481bde8857a13c97b3e436539c430a4b (diff) | |
download | anaconda-ec013936e1ff34f039bc9ed4666ca51c7b2b367a.tar.gz anaconda-ec013936e1ff34f039bc9ed4666ca51c7b2b367a.tar.xz anaconda-ec013936e1ff34f039bc9ed4666ca51c7b2b367a.zip |
only remove device node we used for mounting if we created it
-rw-r--r-- | isys/isys.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/isys/isys.py b/isys/isys.py index a5e070793..0262bcf99 100644 --- a/isys/isys.py +++ b/isys/isys.py @@ -141,10 +141,17 @@ def ddfile(file, megs, pw = None): def mount(device, location, fstype = "ext2", readOnly = 0): location = os.path.normpath(location) + # + # Apparently we don't need to create to create device nodes for + # a device that starts with a '/' (like '/usbdevfs'). + # We note whether or not we created a node so we can cleanup later. + # + createdNode = 0 if device and device != "none" and device[0] != "/": devName = "/tmp/%s" % device makeDevInode(device, devName) device = devName + createdNode = 1 if mountCount.has_key(location) and mountCount[location] > 0: mountCount[location] = mountCount[location] + 1 @@ -155,7 +162,8 @@ def mount(device, location, fstype = "ext2", readOnly = 0): if not rc: mountCount[location] = 1 - if device != "none" and not device.startswith("/dev"): + # did we create a node, if so remove + if createdNode: os.unlink(device) return rc |