Skip to content

Commit

Permalink
fix sql_review log
Browse files Browse the repository at this point in the history
  • Loading branch information
Teingi committed Jul 18, 2024
1 parent 674f327 commit 06a85e5
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions handler/analyzer/analyze_sql_review.py
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,9 @@ def init_option(self):
if files_option:
self.directly_analyze_files = True
self.analyze_files_list = files_option
else:
self.stdio.error("option --file not found, please provide")
return False
db_user_option = Util.get_option(options, 'user')
db_password_option = Util.get_option(options, 'password')
tenant_name_option = Util.get_option(options, 'tenant_name')
Expand Down Expand Up @@ -115,8 +118,10 @@ def handle(self):
return False
self.init_db_connector()
self.local_store_path = os.path.join(self.local_stored_parrent_path, "obdiag_sql_review_result_{0}.html".format(TimeUtils.timestamp_to_filename_time(TimeUtils.get_current_us_timestamp())))
self.stdio.print("use {0} as result store path.".format(self.local_store_path))
self.stdio.verbose("use {0} as result store path.".format(self.local_store_path))
all_results = self.__directly_analyze_files()
if all_results is None:
return
results = self.__parse_results(all_results)
if self.output_type == "html":
html_result = self.__generate_html_result(results)
Expand All @@ -128,7 +133,7 @@ def handle(self):
def __directly_analyze_files(self):
sql_files = self.__get_sql_file_list()
if len(sql_files) == 0:
self.stdio.warn("failed to find SQL files from the --files option provided")
self.stdio.error("failed to find SQL files from the --files option provided")
return None
file_results = {}
sql_results = {}
Expand Down

0 comments on commit 06a85e5

Please sign in to comment.