def umount(what, removeDir=1): what = os.path.normpath(what) if not os.path.isdir(what): raise ValueError, "isys.umount() can only umount by mount point" if mountCount.has_key(what) and mountCount[what] > 1: mountCount[what] = mountCount[what] - 1 return rc = _isys.umount(what) if removeDir and os.path.isdir(what): try: os.rmdir(what) except: pass if not rc and mountCount.has_key(what): del mountCount[what] return rc
def umount(what, removeDir = 1): what = os.path.normpath(what) if not os.path.isdir(what): raise ValueError, "isys.umount() can only umount by mount point" if mountCount.has_key(what) and mountCount[what] > 1: mountCount[what] = mountCount[what] - 1 return rc = _isys.umount(what) if removeDir and os.path.isdir(what): try: os.rmdir(what) except: pass if not rc and mountCount.has_key(what): del mountCount[what] return rc
def umount(what, removeDir = True): what = os.path.normpath(what) if not os.path.isdir(what): raise ValueError, "isys.umount() can only umount by mount point" if mountCount.has_key(what) and mountCount[what] > 1: mountCount[what] = mountCount[what] - 1 return log.debug("isys.py:umount()- going to unmount %s, removeDir = %s" % (what, removeDir)) rc = _isys.umount(what) if removeDir and os.path.isdir(what): try: os.rmdir(what) except: pass if not rc and mountCount.has_key(what): del mountCount[what] return rc