Merge branch 'dev' into permission_protection

This commit is contained in:
Alexandre Aubin 2020-09-09 02:22:35 +02:00
commit c6905ed2c8
2 changed files with 6 additions and 12 deletions

View file

@ -119,8 +119,8 @@ class SystemResourcesDiagnoser(Diagnoser):
def analyzed_kern_log(): def analyzed_kern_log():
cmd = 'tail -n 10000 /var/log/kern.log | grep "oom_reaper: reaped process" || true' cmd = 'tail -n 10000 /var/log/kern.log | grep "oom_reaper: reaped process" || true'
out = subprocess.check_output(cmd, shell=True) out = subprocess.check_output(cmd, shell=True).strip()
lines = out.strip().split("\n") lines = out.split("\n") if out else []
now = datetime.datetime.now() now = datetime.datetime.now()

View file

@ -91,7 +91,7 @@ def app_catalog(full=False, with_categories=False):
"level": infos["level"], "level": infos["level"],
} }
else: 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 # Trim info for categories if not using --full
for category in catalog["categories"]: for category in catalog["categories"]:
@ -170,7 +170,7 @@ def app_info(app, full=False):
return ret return ret
ret["manifest"] = local_manifest 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 ret['settings'] = settings
absolute_app_name, _ = _parse_app_instance_name(app) absolute_app_name, _ = _parse_app_instance_name(app)
@ -2134,12 +2134,6 @@ def _get_manifest_of_app(path):
manifest = manifest_toml.copy() manifest = manifest_toml.copy()
if "arguments" not in manifest:
return manifest
if "install" not in manifest["arguments"]:
return manifest
install_arguments = [] install_arguments = []
for name, values in manifest_toml.get("arguments", {}).get("install", {}).items(): for name, values in manifest_toml.get("arguments", {}).get("install", {}).items():
args = values.copy() args = values.copy()
@ -2154,7 +2148,7 @@ def _get_manifest_of_app(path):
else: 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) 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 return manifest
@ -2571,7 +2565,7 @@ def _parse_args_in_yunohost_format(user_answers, argument_questions):
root_mail = "root@%s" % _get_maindomain() root_mail = "root@%s" % _get_maindomain()
for user in users.keys(): for user in users.keys():
if root_mail in user_info(user)["mail-aliases"]: if root_mail in user_info(user).get("mail-aliases", []):
question_default = user question_default = user
break break