@@ -173,22 +173,27 @@ def get_module_json_obj_by_installed_path(module_name, binary_name_with_path, bi
173173def read_module_info_from_build_output_file ():
174174 global module_info_json_obj
175175
176+ success = True
177+
176178 # Only in case upper 7.0.0 versions have a module-info.mk at build/core/tasks.
177179 # Lower versions sould copy module-info.mk to build/core/tasks than build it again.
178- if not os .path .isfile (os .path .join (build_out_path , MODULE_INFO_FILE_NAME )):
179- logger .warn ("BUILD OUTPUT PATH :" , build_out_path )
180- logger .warn ("Can't find a module-info.json file at build output path." )
180+ module_info_json_file = os .path .join (build_out_path , MODULE_INFO_FILE_NAME )
181+ if not os .path .isfile (module_info_json_file ):
182+ logger .warn (f"BUILD OUTPUT PATH :{ build_out_path } " )
183+ logger .warn (f"Can't find a module-info.json file at build output path.:{ module_info_json_file } " )
181184 logger .warn ("Please copy module-info.mk file to build/core/tasks than build it again." )
182- sys .exit (1 )
183-
185+ success = False
184186 try :
185- module_f = os . path . join ( build_out_path , MODULE_INFO_FILE_NAME )
186- f = open (module_f , 'r' )
187+ logger . info ( f"READ module-info.json : { module_info_json_file } " )
188+ f = open (module_info_json_file , 'r' )
187189 module_info_json_obj = json .loads (f .read ())
188190 f .close ()
191+ except Exception as error :
192+ success = False
193+ logger .warn (f"[ERROR] Failed to read:{ error } " )
189194
190- except IOError :
191- logger . warn ( "[ERROR] Cannot read " , MODULE_INFO_FILE_NAME )
195+ if not success :
196+ sys . exit ( 1 )
192197
193198
194199def set_env_variables_from_result_log ():
0 commit comments