From 5e93b5cfd94f417240ae469f461f6bff6cae1680 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Wed, 5 Jun 2019 16:22:51 +0200 Subject: [PATCH] [fix] When self-upgrading, use a hack to not fill the ended_at and success key right away --- src/yunohost/tools.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/yunohost/tools.py b/src/yunohost/tools.py index b0ed1c449..23fc50483 100644 --- a/src/yunohost/tools.py +++ b/src/yunohost/tools.py @@ -688,6 +688,13 @@ def tools_upgrade(operation_logger, apps=None, system=False): update_log_metadata = "sed -i \"s/ended_at: .*$/ended_at: $(date -u +'%Y-%m-%d %H:%M:%S.%N')/\" {}" update_log_metadata = update_log_metadata.format(operation_logger.md_path) + # Dirty hack such that the operation_logger does not add ended_at + # and success keys in the log metadata. (c.f. the code of the + # is_unit_operation + operation_logger.close()) We take care of + # this ourselves (c.f. the mark_success and updated_log_metadata in + # the huge command launched by os.system) + operation_logger.ended_at = "notyet" + upgrade_completed = "\n" + m18n.n("tools_upgrade_special_packages_completed") command = "(({wait} && {cmd}) && {mark_success} || {mark_failure}; {update_metadata}; echo '{done}') &".format( wait=wait_until_end_of_yunohost_command,