diff --git a/core.py b/core.py index 3ef6dad7..e71930c0 100644 --- a/core.py +++ b/core.py @@ -417,6 +417,7 @@ def check(self, opts): obproxy_check_handler = None observer_check_handler = None result_data = {} + if self.context.obproxy_config.get("servers") is not None and len(self.context.obproxy_config.get("servers")) > 0: obproxy_check_handler = CheckHandler(self.context, check_target_type="obproxy") obproxy_check_handler.handle() @@ -427,13 +428,16 @@ def check(self, opts): observer_check_handler.handle() observer_result = observer_check_handler.execute() result_data['observer'] = observer_result + result_data['store_dir'] = os.path.expanduser("./check_report/") if obproxy_check_handler is not None: obproxy_report_path = os.path.expanduser(obproxy_check_handler.report.get_report_path()) if os.path.exists(obproxy_report_path): + result_data['store_dir'] = os.path.dirname(obproxy_report_path) self.stdio.print("Check obproxy finished. For more details, please run cmd '" + Fore.YELLOW + " cat {0} ".format(obproxy_check_handler.report.get_report_path()) + Style.RESET_ALL + "'") if observer_check_handler is not None: observer_report_path = os.path.expanduser(observer_check_handler.report.get_report_path()) if os.path.exists(observer_report_path): + result_data['store_dir'] = os.path.dirname(observer_report_path) self.stdio.print("Check observer finished. For more details, please run cmd'" + Fore.YELLOW + " cat {0} ".format(observer_check_handler.report.get_report_path()) + Style.RESET_ALL + "'") return ObdiagResult(ObdiagResult.SUCCESS_CODE, data=result_data)