Skip to content

Commit

Permalink
Merge pull request #188 from wayyoungboy/master
Browse files Browse the repository at this point in the history
fix ash report data error
  • Loading branch information
Teingi authored May 6, 2024
2 parents 20acd25 + 93cf3c9 commit 99637d6
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions handler/gather/gather_ash_report.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
from common.command import get_observer_version, get_observer_version_by_sql
from common.ob_connector import OBConnector
from common.obdiag_exception import OBDIAGFormatException, OBDIAGException
from common.ssh import SshHelper
from common.tool import DirectoryUtil, TimeUtils, Util, StringUtils
from stdio import SafeStdio
from colorama import Fore, Style
Expand All @@ -41,6 +42,7 @@ def __init__(self, context, gather_pack_dir='./'):
self.context = context
self.stdio = self.context.stdio
self.gather_pack_dir = gather_pack_dir
self.ob_cluster = self.context.cluster_config
if self.context.get_variable("gather_timestamp", None):
self.gather_timestamp = self.context.get_variable("gather_timestamp")
else:
Expand Down Expand Up @@ -78,7 +80,8 @@ def version_check(self):
observer_version = get_observer_version_by_sql(self.ob_cluster, self.stdio)
except Exception as e:
if len(self.observer_nodes) > 0:
observer_version = get_observer_version(True, self.observer_nodes[0]["ssher"],
ssher=SshHelper(self.observer_nodes[0]["ip"], self.observer_nodes[0]["ssh_port"], self.observer_nodes[0]["ssh_username"], self.observer_nodes[0]["ssh_password"])
observer_version = get_observer_version(True, ssher,
self.observer_nodes[0]["home_path"],self.stdio)
else:
self.stdio.warn("RCAHandler Failed to get observer version:{0}".format(e))
Expand Down Expand Up @@ -110,9 +113,9 @@ def execute(self):

with open(self.ash_report_file_name, 'w+') as f:
f.write(ash_report)
self.stdio.print("save ash report file name:"+ Fore.YELLOW +"{0}".format(self.ash_report_file_name)+Style.RESET_ALL)
self.stdio.print("save ash report file name: "+ Fore.YELLOW +"{0}".format(self.ash_report_file_name)+Style.RESET_ALL)
self.result_summary_file_name = os.path.join(self.report_path, "result_summary.txt")
with open(self.ash_report_file_name, 'w+') as f:
with open(self.result_summary_file_name, 'w+') as f:
f.write(self.ash_report_file_name)

except Exception as e:
Expand Down

0 comments on commit 99637d6

Please sign in to comment.