From 8b80e29424af1665dbf0438eb15fd2f9b188609b Mon Sep 17 00:00:00 2001 From: Chris Lumens Date: Fri, 6 Jun 2008 13:14:40 -0400 Subject: Support mounting nfsiso sources in mountDirectory. --- image.py | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) (limited to 'image.py') diff --git a/image.py b/image.py index 8b6287771..45779ef21 100644 --- a/image.py +++ b/image.py @@ -130,22 +130,18 @@ def mountDirectory(methodstr, messageWindow): method = methodstr[3:] (device, fstype, path) = method.split(":", 3) device = method[0:method.index(":")] + + if not device.startswith("/dev/"): + device = "/dev/%s" % device + elif methodstr.startswith("nfsiso:"): + device = methodstr[7:] + fstype = "nfs" else: return - # First check to see if isodir is mounted. - f = open("/proc/mounts", "r") - lines = f.readlines() - f.close() - - if not device.startswith("/dev/"): - device = "/dev/%s" %(device,) - - for l in lines: - s = string.split(l) - if s[0] == device: - # It is, so there's no need to try again. - return + # No need to mount it again. + if os.path.ismount("/mnt/isodir"): + return try: isys.mount(device, "/mnt/isodir", fstype = fstype) -- cgit