mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
[enh] Display log help at the end of logs
This commit is contained in:
parent
cad0b9ba1f
commit
9d59c8555a
3 changed files with 15 additions and 12 deletions
|
@ -226,6 +226,7 @@
|
|||
"log_backup_restore_system": "Restore system from a backup archive",
|
||||
"log_backup_restore_app": "Restore '{}' from a backup archive",
|
||||
"log_remove_on_failed_restore": "Remove '{}' after a failed restore from a backup archive",
|
||||
"log_remove_on_failed_install": "Remove '{}' after a failed installation",
|
||||
"log_domain_add": "Add '{}' domain into system configuration",
|
||||
"log_domain_remove": "Remove '{}' domain from system configuration",
|
||||
"log_dyndns_subscribe": "Subscribe to a YunoHost subdomain '{}'",
|
||||
|
|
|
@ -788,7 +788,7 @@ def app_install(uo, auth, app, label=None, args=None, no_remove_on_failure=False
|
|||
logger.exception(m18n.n('unexpected_error'))
|
||||
finally:
|
||||
if install_retcode != 0:
|
||||
uo.error(m18n.n('unexpected_error'))
|
||||
error_msg = uo.error(m18n.n('unexpected_error'))
|
||||
if not no_remove_on_failure:
|
||||
# Setup environment for remove script
|
||||
env_dict_remove = {}
|
||||
|
@ -821,9 +821,10 @@ def app_install(uo, auth, app, label=None, args=None, no_remove_on_failure=False
|
|||
app_ssowatconf(auth)
|
||||
|
||||
if install_retcode == -1:
|
||||
raise MoulinetteError(errno.EINTR,
|
||||
m18n.g('operation_interrupted'))
|
||||
raise MoulinetteError(errno.EIO, m18n.n('installation_failed'))
|
||||
msg = m18n.n('operation_interrupted') + " " + error_msg
|
||||
raise MoulinetteError(errno.EINTR, msg)
|
||||
msg = m18n.n('installation_failed') + " " + error_msg
|
||||
raise MoulinetteError(errno.EIO, msg)
|
||||
|
||||
# Clean hooks and add new ones
|
||||
hook_remove(app_instance_name)
|
||||
|
|
|
@ -349,7 +349,7 @@ class UnitOperation(object):
|
|||
"""
|
||||
Declare the failure of the unit operation
|
||||
"""
|
||||
self.close(error)
|
||||
return self.close(error)
|
||||
|
||||
def close(self, error=None):
|
||||
"""
|
||||
|
@ -367,18 +367,19 @@ class UnitOperation(object):
|
|||
desc = _get_description_from_name(self.name)
|
||||
if error is None:
|
||||
if is_api:
|
||||
logger.info(m18n.n('log_link_to_log', name=self.name, desc=desc))
|
||||
msg = m18n.n('log_link_to_log', name=self.name, desc=desc)
|
||||
else:
|
||||
logger.info(m18n.n('log_help_to_get_log', name=self.name, desc=desc))
|
||||
msg = m18n.n('log_help_to_get_log', name=self.name, desc=desc)
|
||||
logger.info(msg)
|
||||
else:
|
||||
if is_api:
|
||||
logger.warning("<strong>" + m18n.n('log_link_to_failed_log',
|
||||
name=self.name, desc=desc) +
|
||||
"</strong>")
|
||||
msg = "<strong>" + m18n.n('log_link_to_failed_log',
|
||||
name=self.name, desc=desc) + "</strong>"
|
||||
else:
|
||||
logger.warning(m18n.n('log_help_to_get_failed_log', name=self.name, desc=desc))
|
||||
|
||||
msg = m18n.n('log_help_to_get_failed_log', name=self.name, desc=desc)
|
||||
logger.warning(msg)
|
||||
self.flush()
|
||||
return msg
|
||||
|
||||
def __del__(self):
|
||||
"""
|
||||
|
|
Loading…
Add table
Reference in a new issue