mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[fix] Do not miserably crash if status.json can't be decoded
This commit is contained in:
parent
9e2f314ea5
commit
b6cff68d73
1 changed files with 6 additions and 0 deletions
|
@ -1773,12 +1773,18 @@ def _get_app_status(app_id, format_date=False):
|
|||
raise YunohostError('app_unknown')
|
||||
status = {}
|
||||
|
||||
regen_status = True
|
||||
try:
|
||||
with open(app_setting_path + '/status.json') as f:
|
||||
status = json.loads(str(f.read()))
|
||||
regen_status = False
|
||||
except IOError:
|
||||
logger.debug("status file not found for '%s'", app_id,
|
||||
exc_info=1)
|
||||
except Exception as e:
|
||||
logger.warning("could not open or decode %s : %s ... regenerating.", app_setting_path + '/status.json', str(e))
|
||||
|
||||
if regen_status:
|
||||
# Create app status
|
||||
status = {
|
||||
'installed_at': app_setting(app_id, 'install_time'),
|
||||
|
|
Loading…
Add table
Reference in a new issue