From ab57a7fef41a274a8d0bdab6463e39fcb629d4d5 Mon Sep 17 00:00:00 2001 From: lejeune quentin Date: Thu, 16 Feb 2023 10:28:21 +0000 Subject: [PATCH] [FIX] hw_drivers: Certificate checked before start nginx Currently we verify the SSL certificate of the iot after starting the nginx web server. So for the Windows iot if a new certificate is downloaded it will only be loaded by nginx on the next restart of the iot because the process that runs nginx is a child of the one that runs the iot With this commit we restart the windows iot if a new certificate is uploaded closes odoo/odoo#112945 X-original-commit: 880afb3006ece93ee6575c977233bfb61081bf3a Signed-off-by: Quentin Lejeune (qle) --- addons/hw_drivers/tools/helpers.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/addons/hw_drivers/tools/helpers.py b/addons/hw_drivers/tools/helpers.py index baf75d1cdac..af8b3c483e5 100644 --- a/addons/hw_drivers/tools/helpers.py +++ b/addons/hw_drivers/tools/helpers.py @@ -257,7 +257,10 @@ def load_certificate(): Path(get_path_nginx()).joinpath('conf/nginx-cert.crt').write_text(result['x509_pem']) Path(get_path_nginx()).joinpath('conf/nginx-cert.key').write_text(result['private_key_pem']) time.sleep(3) - start_nginx_server() + if platform.system() == 'Windows': + odoo_restart(0) + elif platform.system() == 'Linux': + start_nginx_server() def download_iot_handlers(auto=True): """