From 7483d04f54b1423a1191aca9523d8839b0c404c8 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 9 Sep 2020 00:06:23 +0200 Subject: [PATCH] Fix a weird issue that may arise during test, strangely unspotted so far --- src/yunohost/app.py | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/src/yunohost/app.py b/src/yunohost/app.py index 8cf83e594..dfea9dc52 100644 --- a/src/yunohost/app.py +++ b/src/yunohost/app.py @@ -91,7 +91,7 @@ def app_catalog(full=False, with_categories=False): "level": infos["level"], } else: - infos["manifest"]["arguments"] = _set_default_ask_questions(infos["manifest"]["arguments"]) + infos["manifest"]["arguments"] = _set_default_ask_questions(infos["manifest"].get("arguments", {})) # Trim info for categories if not using --full for category in catalog["categories"]: @@ -170,7 +170,7 @@ def app_info(app, full=False): return ret ret["manifest"] = local_manifest - ret["manifest"]["arguments"] = _set_default_ask_questions(ret["manifest"]["arguments"]) + ret["manifest"]["arguments"] = _set_default_ask_questions(ret["manifest"].get("arguments", {})) ret['settings'] = settings absolute_app_name, _ = _parse_app_instance_name(app) @@ -2130,12 +2130,6 @@ def _get_manifest_of_app(path): manifest = manifest_toml.copy() - if "arguments" not in manifest: - return manifest - - if "install" not in manifest["arguments"]: - return manifest - install_arguments = [] for name, values in manifest_toml.get("arguments", {}).get("install", {}).items(): args = values.copy() @@ -2150,7 +2144,7 @@ def _get_manifest_of_app(path): else: raise YunohostError("There doesn't seem to be any manifest file in %s ... It looks like an app was not correctly installed/removed." % path, raw_msg=True) - manifest["arguments"] = _set_default_ask_questions(manifest["arguments"]) + manifest["arguments"] = _set_default_ask_questions(manifest.get("arguments", {})) return manifest