From 288b58e0b552987e6deb6b3b1bcdfaf5ff8af396 Mon Sep 17 00:00:00 2001 From: Sunil Mohan Adapa Date: Tue, 16 Sep 2025 14:50:23 -0700 Subject: [PATCH] storage: Fix disk usage checking with disconnected SSH mounts - When disconnected sshfs mounts are present, then df command prints the disk usage for the remaining disks but prints a warning to the stderr and return a non-zero return code. Accommodate this case and parse the information for all the available disks. Tests: - Create a remote backup location and mount it. When the SSH process is killed, it leaves a mount point that is not properly connected. View the storage page to see that disk usage for other partitions is shown properly. Signed-off-by: Sunil Mohan Adapa Reviewed-by: Veiko Aasa --- plinth/modules/storage/privileged.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plinth/modules/storage/privileged.py b/plinth/modules/storage/privileged.py index e5422eced..dc156fa3a 100644 --- a/plinth/modules/storage/privileged.py +++ b/plinth/modules/storage/privileged.py @@ -325,7 +325,7 @@ def usage_info() -> str: 'df', '--exclude-type=tmpfs', '--exclude-type=devtmpfs', '--block-size=1', '--output=source,fstype,size,used,avail,pcent,target' ] - return subprocess.check_output(command).decode() + return action_utils.run(command, check=False).stdout.decode() @privileged