|
|
@ -617,6 +617,13 @@ def isMount(path):
|
|
|
|
map(lambda x: [x[0], x[1]], map(lambda x: x.split(" "),
|
|
|
|
map(lambda x: [x[0], x[1]], map(lambda x: x.split(" "),
|
|
|
|
open(mtabFile)))),[""]))[0]
|
|
|
|
open(mtabFile)))),[""]))[0]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def commonPath(*paths):
|
|
|
|
|
|
|
|
"""Return common path from list of paths"""
|
|
|
|
|
|
|
|
paths = map(lambda x:os.path.abspath(x).split('/'),paths)
|
|
|
|
|
|
|
|
res = map(lambda x:x[0],
|
|
|
|
|
|
|
|
filter(lambda x:filter(lambda y:x[0]==y,x[1:]),zip(*paths)))
|
|
|
|
|
|
|
|
return "/".join(res)
|
|
|
|
|
|
|
|
|
|
|
|
def childMounts(path):
|
|
|
|
def childMounts(path):
|
|
|
|
"""Get all mount points which contain path"""
|
|
|
|
"""Get all mount points which contain path"""
|
|
|
|
if path != "none":
|
|
|
|
if path != "none":
|
|
|
@ -627,7 +634,8 @@ def childMounts(path):
|
|
|
|
if not os.access(mtabFile,os.R_OK):
|
|
|
|
if not os.access(mtabFile,os.R_OK):
|
|
|
|
return ""
|
|
|
|
return ""
|
|
|
|
return reduce(lambda x,y: x + [y],
|
|
|
|
return reduce(lambda x,y: x + [y],
|
|
|
|
filter(lambda x: absPath in x[0] or absPath in x[1],
|
|
|
|
filter(lambda x: commonPath(absPath,x[0])==absPath or \
|
|
|
|
|
|
|
|
commonPath(absPath,x[1])==absPath,
|
|
|
|
map(lambda x: [x[0], x[1]],
|
|
|
|
map(lambda x: [x[0], x[1]],
|
|
|
|
map(lambda x: x.split(" "),
|
|
|
|
map(lambda x: x.split(" "),
|
|
|
|
open(mtabFile)))),
|
|
|
|
open(mtabFile)))),
|
|
|
|