]> git.donarmstrong.com Git - dsa-puppet.git/blob - modules/bacula/files/bacula-backup-dirs
Apply Aurelien's nfs patch to the dsa-check-libs copy in puppet also
[dsa-puppet.git] / modules / bacula / files / bacula-backup-dirs
1 #! /usr/bin/python
2
3 import re
4
5 MI_RE = re.compile(r'(?P<mountid>\d+) (?P<parentid>\d+) (?P<majorminor>\d+:\d+) (?P<root>\S+) (?P<mountpoint>\S+) (?P<options>\S+) (?P<optional>(?:\S+\s)+)?- (?P<fstype>\S+) (?P<mountsrc>\S+) (?P<superopts>\S+)')
6
7 for line in file("/proc/self/mountinfo"):
8     mi = MI_RE.match(line)
9     if mi is None:
10         # XXX: handle error?
11         continue
12     gd = mi.groupdict()
13     # Skip bind mounts
14     if gd.get("root") != "/":
15         continue
16     if gd.get("fstype") not in [ "ext2", "ext3", "ext4", "xfs", "jfs"]:
17         continue
18     print gd["mountpoint"]