From 264e2023473849fd555d5734b469a21d78ee111a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Lebleu?= Date: Fri, 2 Oct 2015 15:03:30 +0200 Subject: [PATCH] [fix] Prevent to get/set non-installed app setting --- lib/yunohost/app.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/yunohost/app.py b/lib/yunohost/app.py index a38b87e89..24c04945f 100644 --- a/lib/yunohost/app.py +++ b/lib/yunohost/app.py @@ -781,8 +781,11 @@ def app_setting(app, key, value=None, delete=False): delete -- Delete the key """ - settings_file = apps_setting_path + app +'/settings.yml' + if not _is_installed(app): + raise MoulinetteError(errno.EINVAL, + m18n.n('app_not_installed', app)) + settings_file = apps_setting_path + app +'/settings.yml' try: with open(settings_file) as f: app_settings = yaml.load(f)