From d1f0e1976c5ba5c9d3db3dcce0924ab33b7cbc96 Mon Sep 17 00:00:00 2001 From: Fabio Manganiello Date: Sat, 6 May 2023 18:53:16 +0200 Subject: [PATCH] Exclude squashfs/loopback mounts from `system.disk_info`. --- platypush/plugins/system/__init__.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/platypush/plugins/system/__init__.py b/platypush/plugins/system/__init__.py index 8b3c962f2..de0b90dc9 100644 --- a/platypush/plugins/system/__init__.py +++ b/platypush/plugins/system/__init__.py @@ -223,7 +223,12 @@ class SystemPlugin(SensorPlugin, EntityManager): @staticmethod def _disk_info() -> List[Disk]: - parts = {part.device: part._asdict() for part in psutil.disk_partitions()} + parts = { + part.device: part._asdict() + for part in psutil.disk_partitions() + if part.fstype != 'squashfs' # Exclude loopback mounts + } + basename_parts = {os.path.basename(part): part for part in parts} io_stats = { basename_parts[disk]: stats._asdict()