mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
appv2: fix env not including vars for v1->v2 upgrade
This commit is contained in:
parent
1c95bcff09
commit
2b2d49a504
1 changed files with 4 additions and 3 deletions
|
@ -706,8 +706,9 @@ def app_upgrade(app=[], url=None, file=None, force=False, no_safety_backup=False
|
|||
|
||||
# Boring stuff : the resource upgrade may have added/remove/updated setting
|
||||
# so we need to reflect this in the env_dict used to call the actual upgrade script x_x
|
||||
# Or: the old manifest may be in v1 and the new in v2, so force to add the setting in env
|
||||
env_dict = _make_environment_for_app_script(
|
||||
app_instance_name, workdir=extracted_app_folder, action="upgrade"
|
||||
app_instance_name, workdir=extracted_app_folder, action="upgrade", include_app_settings=True,
|
||||
)
|
||||
env_dict.update(env_dict_more)
|
||||
|
||||
|
@ -2731,7 +2732,7 @@ def _assert_no_conflicting_apps(domain, path, ignore_app=None, full_domain=False
|
|||
|
||||
|
||||
def _make_environment_for_app_script(
|
||||
app, args={}, args_prefix="APP_ARG_", workdir=None, action=None
|
||||
app, args={}, args_prefix="APP_ARG_", workdir=None, action=None, include_app_settings=False,
|
||||
):
|
||||
app_setting_path = os.path.join(APPS_SETTING_PATH, app)
|
||||
|
||||
|
@ -2758,7 +2759,7 @@ def _make_environment_for_app_script(
|
|||
env_dict[f"YNH_{args_prefix}{arg_name_upper}"] = str(arg_value)
|
||||
|
||||
# If packaging format v2, load all settings
|
||||
if manifest["packaging_format"] >= 2:
|
||||
if manifest["packaging_format"] >= 2 or include_app_settings:
|
||||
env_dict["app"] = app
|
||||
for setting_name, setting_value in _get_app_settings(app).items():
|
||||
# Ignore special internal settings like checksum__
|
||||
|
|
Loading…
Add table
Reference in a new issue