Skip to content

Commit 7effcd2

Browse files
committed
adding opts exclude
1 parent 362e093 commit 7effcd2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

.env.example

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,5 @@ TIMEOUT=259200
1212
RETENTION_TIME=86400
1313

1414
DISK_EXCLUDE=/run,/sys,/boot,/dev,/proc,/gdrive,/var/lib
15-
DISK_FS_EXCLUDE=tmpfs,overlay
15+
DISK_FS_EXCLUDE=tmpfs,overlay
16+
DISK_OPTS_EXCLUDE=ro

report.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
RETENTION_TIME = int(os.getenv('RETENTION_TIME', '86400'))
3535
DISK_EXCLUDE = os.getenv('DISK_EXCLUDE','/run,/sys,/boot,/dev,/proc,/var/lib').split(",")
3636
DISK_FS_EXCLUDE = os.getenv('DISK_FS_EXCLUDE', 'tmpfs,overlay').split(",")
37+
DISK_OPTS_EXCLUDE = os.getenv('DISK_OPTS_EXCLUDE', 'ro').split(",")
3738

3839
logging.basicConfig(level=logging.INFO, format="%(asctime)s - %(message)s")
3940
UUID = str(uuid.uuid4()).replace("-", "")
@@ -128,7 +129,7 @@ def get_disk_partitions():
128129
for part in parts:
129130
result.append(part)
130131
for i in DISK_EXCLUDE:
131-
if part.mountpoint.find(i) != -1 or part.fstype in DISK_FS_EXCLUDE:
132+
if part.mountpoint.find(i) != -1 or part.fstype in DISK_FS_EXCLUDE or len(set(part.opts.split(",")) & set(DISK_OPTS_EXCLUDE)) > 0:
132133
result.remove(part)
133134
break
134135

0 commit comments

Comments
 (0)