Skip to content

Commit

Permalink
check silent add store_dir (#566)
Browse files Browse the repository at this point in the history
  • Loading branch information
wayyoungboy authored Nov 21, 2024
1 parent 9aa2181 commit a3f7fde
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions core.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand All @@ -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)

Expand Down

0 comments on commit a3f7fde

Please sign in to comment.