From 7f22dcfb285f5c0a8ffe8664d525449a29059081 Mon Sep 17 00:00:00 2001 From: "Yaroslav Soroko (yaso)" Date: Thu, 1 Feb 2024 14:20:24 +0000 Subject: [PATCH] [IMP] iot: add logs of IoT Box image/version Before the current PR, the version of Odoo along with the git branch of the IoT Box and the associated image were never logged. Adding this information to logs allow to to debug / inspect issues more easily task-3716879 closes odoo/odoo#152558 X-original-commit: 8bf1c8984948b003544427eb81f66514ed783bd0 Signed-off-by: Quentin Lejeune (qle) --- addons/hw_drivers/main.py | 1 + addons/hw_drivers/tools/helpers.py | 1 + 2 files changed, 2 insertions(+) diff --git a/addons/hw_drivers/main.py b/addons/hw_drivers/main.py index 7f21d15d56a..f86ba075918 100644 --- a/addons/hw_drivers/main.py +++ b/addons/hw_drivers/main.py @@ -89,6 +89,7 @@ class Manager(Thread): """ helpers.start_nginx_server() + _logger.info("IoT Box Image version: %s", helpers.get_version()) if platform.system() == 'Linux' and helpers.get_odoo_server_url(): helpers.check_git_branch() helpers.generate_password() diff --git a/addons/hw_drivers/tools/helpers.py b/addons/hw_drivers/tools/helpers.py index 5a1fb547bf3..328da8b0af2 100644 --- a/addons/hw_drivers/tools/helpers.py +++ b/addons/hw_drivers/tools/helpers.py @@ -147,6 +147,7 @@ def check_git_branch(): db_branch = 'master' local_branch = subprocess.check_output(git + ['symbolic-ref', '-q', '--short', 'HEAD']).decode('utf-8').rstrip() + _logger.info("Current IoT Box local git branch: %s / Associated Odoo database's git branch: %s", local_branch, db_branch) if db_branch != local_branch: with writable():