Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix ash report data error #188

Merged
merged 1 commit into from
May 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading