mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] Enable stdinfo when running app script
This commit is contained in:
parent
b8d8f72e36
commit
5cd1563014
1 changed files with 11 additions and 5 deletions
|
@ -489,7 +489,9 @@ def app_change_url(auth, app, domain, path):
|
|||
os.system('chmod +x %s' % os.path.join(os.path.join(APP_TMP_FOLDER, "scripts", "change_url")))
|
||||
|
||||
# XXX journal
|
||||
if hook_exec(os.path.join(APP_TMP_FOLDER, 'scripts/change_url'), args=args_list, env=env_dict, user="root") != 0:
|
||||
if hook_exec(os.path.join(APP_TMP_FOLDER, 'scripts/change_url'),
|
||||
args=args_list, env=env_dict, user="root",
|
||||
enable_stdinfo=True) != 0:
|
||||
logger.error("Failed to change '%s' url." % app)
|
||||
|
||||
# restore values modified by app_checkurl
|
||||
|
@ -603,7 +605,9 @@ def app_upgrade(auth, app=[], url=None, file=None):
|
|||
|
||||
# Execute App upgrade script
|
||||
os.system('chown -hR admin: %s' % INSTALL_TMP)
|
||||
if hook_exec(extracted_app_folder + '/scripts/upgrade', args=args_list, env=env_dict, user="root") != 0:
|
||||
if hook_exec(extracted_app_folder + '/scripts/upgrade',
|
||||
args=args_list, env=env_dict, user="root",
|
||||
enable_stdinfo=True) != 0:
|
||||
logger.error(m18n.n('app_upgrade_failed', app=app_instance_name))
|
||||
else:
|
||||
now = int(time.time())
|
||||
|
@ -738,7 +742,7 @@ def app_install(auth, app, label=None, args=None, no_remove_on_failure=False):
|
|||
try:
|
||||
install_retcode = hook_exec(
|
||||
os.path.join(extracted_app_folder, 'scripts/install'),
|
||||
args=args_list, env=env_dict, user="root")
|
||||
args=args_list, env=env_dict, user="root", enable_stdinfo=True)
|
||||
except (KeyboardInterrupt, EOFError):
|
||||
install_retcode = -1
|
||||
except:
|
||||
|
@ -755,7 +759,8 @@ def app_install(auth, app, label=None, args=None, no_remove_on_failure=False):
|
|||
# Execute remove script
|
||||
remove_retcode = hook_exec(
|
||||
os.path.join(extracted_app_folder, 'scripts/remove'),
|
||||
args=[app_instance_name], env=env_dict_remove, user="root")
|
||||
args=[app_instance_name], env=env_dict_remove, user="root",
|
||||
enable_stdinfo=True)
|
||||
if remove_retcode != 0:
|
||||
logger.warning(m18n.n('app_not_properly_removed',
|
||||
app=app_instance_name))
|
||||
|
@ -826,7 +831,8 @@ def app_remove(auth, app):
|
|||
env_dict["YNH_APP_INSTANCE_NAME"] = app
|
||||
env_dict["YNH_APP_INSTANCE_NUMBER"] = str(app_instance_nb)
|
||||
|
||||
if hook_exec('/tmp/yunohost_remove/scripts/remove', args=args_list, env=env_dict, user="root") == 0:
|
||||
if hook_exec('/tmp/yunohost_remove/scripts/remove', args=args_list,
|
||||
env=env_dict, user="root", enable_stdinfo=True) == 0:
|
||||
logger.success(m18n.n('app_removed', app=app))
|
||||
|
||||
if os.path.exists(app_setting_path):
|
||||
|
|
Loading…
Add table
Reference in a new issue