[fix] Prevent to get/set non-installed app setting

This commit is contained in:
Jérôme Lebleu 2015-10-02 15:03:30 +02:00
parent 999a61d2b2
commit 264e202347

View file

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