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 <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
This commit is contained in:
Sunil Mohan Adapa 2025-09-16 14:50:23 -07:00 committed by Veiko Aasa
parent 7c0fa00536
commit 288b58e0b5
No known key found for this signature in database
GPG Key ID: 478539CAE680674E

View File

@ -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