mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] Do not break if disk is not a dict (fixes #redmine-919) (#315)
This commit is contained in:
parent
a687b85025
commit
5e4cce3f1f
1 changed files with 9 additions and 5 deletions
|
@ -516,11 +516,15 @@ def tools_diagnosis(auth, private=False):
|
|||
else:
|
||||
diagnosis['system']['disks'] = {}
|
||||
for disk in disks:
|
||||
diagnosis['system']['disks'][disk] = 'Mounted on %s, %s (%s free)' % (
|
||||
disks[disk]['mnt_point'],
|
||||
disks[disk]['size'],
|
||||
disks[disk]['avail']
|
||||
)
|
||||
if isinstance(disk, str):
|
||||
diagnosis['system']['disks'] = disk
|
||||
else:
|
||||
diagnosis['system']['disks'][disk] = 'Mounted on %s, %s (%s free)' % (
|
||||
disks[disk]['mnt_point'],
|
||||
disks[disk]['size'],
|
||||
disks[disk]['avail']
|
||||
)
|
||||
|
||||
|
||||
try:
|
||||
system = monitor_system(units=['cpu', 'memory'], human_readable=True)
|
||||
|
|
Loading…
Add table
Reference in a new issue