Fix minor issue with main_space diagnosis: duplicated error/warning, missing / partition when it's on a /dev/loop

This commit is contained in:
Alexandre Aubin 2021-03-22 17:46:32 +01:00
parent f0827451ca
commit 09d306924a

View file

@ -77,7 +77,7 @@ class SystemResourcesDiagnoser(Diagnoser):
# Ignore /dev/loop stuff which are ~virtual partitions ? (e.g. mounted to /snap/)
disk_partitions = [
d for d in disk_partitions if not d.device.startswith("/dev/loop")
d for d in disk_partitions if d.mountpoint in ["/", "/var"] or not d.device.startswith("/dev/loop")
]
for disk_partition in disk_partitions:
@ -139,7 +139,7 @@ class SystemResourcesDiagnoser(Diagnoser):
status="ERROR",
summary="diagnosis_rootfstotalspace_critical",
)
if main_space < 14 * GB:
elif main_space < 14 * GB:
yield dict(
meta={"test": "rootfstotalspace"},
data={"space": human_size(main_space)},