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,12 +516,16 @@ def tools_diagnosis(auth, private=False):
|
||||||
else:
|
else:
|
||||||
diagnosis['system']['disks'] = {}
|
diagnosis['system']['disks'] = {}
|
||||||
for disk in disks:
|
for disk in disks:
|
||||||
|
if isinstance(disk, str):
|
||||||
|
diagnosis['system']['disks'] = disk
|
||||||
|
else:
|
||||||
diagnosis['system']['disks'][disk] = 'Mounted on %s, %s (%s free)' % (
|
diagnosis['system']['disks'][disk] = 'Mounted on %s, %s (%s free)' % (
|
||||||
disks[disk]['mnt_point'],
|
disks[disk]['mnt_point'],
|
||||||
disks[disk]['size'],
|
disks[disk]['size'],
|
||||||
disks[disk]['avail']
|
disks[disk]['avail']
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
system = monitor_system(units=['cpu', 'memory'], human_readable=True)
|
system = monitor_system(units=['cpu', 'memory'], human_readable=True)
|
||||||
except MoulinetteError as e:
|
except MoulinetteError as e:
|
||||||
|
|
Loading…
Add table
Reference in a new issue