summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lbup/_mountinfo.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/lbup/_mountinfo.py b/lbup/_mountinfo.py
index 35be209..973e135 100644
--- a/lbup/_mountinfo.py
+++ b/lbup/_mountinfo.py
@@ -48,6 +48,9 @@ class _MountEntry:
raw_entry = None
"raw mountinfo line, bytes"
+ parent = None
+ "parent mountinfo entry, None if it does not exit"
+
def __init__(self, line):
self.raw_entry = line
@@ -118,6 +121,13 @@ class MountInfo:
self.mounts = mounts
+ for e in mounts.values():
+ try:
+ e.parent = mounts[e.parent_id]
+ except KeyError:
+ pass
+
+
def __str__(self):
return '%s(%d entries)' % (self.__class__.__name__, len(self.mounts))