Commit a188f1ef authored by Balazs Lecz's avatar Balazs Lecz
Browse files

LXC: use utils.GetMounts()

Signed-off-by: default avatarBalazs Lecz <>
Reviewed-by: default avatarIustin Pop <>
parent 1b045f5d
......@@ -99,23 +99,15 @@ class LXCHypervisor(hv_base.BaseHypervisor):
def _GetMountSubdirs(path):
"""Return the list of mountpoints under a given path.
This function is Linux-specific.
#TODO(iustin): investigate and document non-linux options
#(e.g. via mount output)
data = []
fh = open("/proc/mounts", "r")
for line in fh:
_, mountpoint, _ = line.split(" ", 2)
if (mountpoint.startswith(path) and
mountpoint != path):
data.sort(key=lambda x: x.count("/"), reverse=True)
return data
result = []
for _, mountpoint, _, _ in utils.GetMounts():
if (mountpoint.startswith(path) and
mountpoint != path):
result.sort(key=lambda x: x.count("/"), reverse=True)
return result
def _InstanceDir(cls, instance_name):
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment