From 5f0086611e2b8ca5bbf8873a931171ece8dc6cba Mon Sep 17 00:00:00 2001 From: "bodong.yang" Date: Wed, 25 Dec 2024 02:38:53 +0000 Subject: [PATCH] ota_core.OTAClient: refine the OTA request reject msg on otaclient not started --- src/otaclient/ota_core.py | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/otaclient/ota_core.py b/src/otaclient/ota_core.py index b787c0d29..f42b4c665 100644 --- a/src/otaclient/ota_core.py +++ b/src/otaclient/ota_core.py @@ -67,7 +67,12 @@ ) from otaclient._utils import SharedOTAClientStatusWriter, get_traceback, wait_and_log from otaclient.boot_control import BootControllerProtocol, get_boot_controller -from otaclient.configs.cfg import cfg, ecu_info, proxy_info +from otaclient.configs.cfg import ( + ECU_INFO_LOADED_SUCCESSFULLY, + cfg, + ecu_info, + proxy_info, +) from otaclient.create_standby import ( StandbySlotCreatorProtocol, get_standby_slot_creator, @@ -864,9 +869,10 @@ def main( ) elif not self.started: - _err_msg = ( - "otaclient is not started, might be due to broken ecu_info.yaml" - ) + _err_msg = "reject OTA request due to otaclient is not (yet) started." + if not ECU_INFO_LOADED_SUCCESSFULLY: + _err_msg = f"reject OTA request due to {cfg.ECU_INFO_FPATH} missing or broken" + logger.error(_err_msg) resp_queue.put_nowait( IPCResponse(