summaryrefslogtreecommitdiff
path: root/sysutils/discus/files/patch-discus.py
blob: 81d613d89e0cdca834191dda4c1b154b1c7f1aea (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
--- discus.py.orig	2023-01-21 12:38:18 UTC
+++ discus.py
@@ -350,16 +350,8 @@ def read_mounts(mtab, skip_list):
     """Read the mounts file."""
     mounts = []
 
-    # If the first letter of the mtab file begins with a !, it is a
-    # shell command to be executed, and not a file to be read.  Idea
-    # provided by John Soward.
-    if mtab[0] == "!":
-        mtab = subprocess.getoutput(mtab[1:])
-        mtab = str.split(mtab, "\n")
-    else:
-        fp = open(mtab)
-        mtab = fp.readlines()
-        fp.close()
+    mtab = subprocess.getoutput('/sbin/mount -p')
+    mtab = str.split(mtab, "\n")
 
     # Extract the mounted filesystems from the read file.
     for entry in mtab:
@@ -432,7 +424,7 @@ def main():
     """Define main program."""
     options = parse_options()
     interpret_options(options)
-    mounts = read_mounts(opts["mtab"], opts["skip_list"])
+    mounts = read_mounts(None, opts["skip_list"])
     headers = get_header(opts["graph"])
     stats_factory = StatsFactory(opts["reserved"])
     size_formatter = SizeFormatter(opts["smart"], opts["placing"],