Skip to content

Commit

Permalink
3.0 update log (#646)
Browse files Browse the repository at this point in the history
* fix: conf path

* fix: conf path

* remote_client support strict_host_key_checking

* Clean rca old *scene.py files

* fix some bugs

* fix: gather all not support scope option

* add check task

* update log
  • Loading branch information
wayyoungboy authored Dec 20, 2024
1 parent 8647c28 commit 0c7f21e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 6 additions & 5 deletions src/handler/gather/gather_component_log.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,11 +230,11 @@ def handle(self):
new_context.stdio = self.stdio.sub_io()
# use Process must delete ssh_client, and GatherLogOnNode will rebuild it.
if "ssh_client" in node or "ssher" in node:
clear_node = copy.deepcopy(node)
if "ssh_client" in node:
del clear_node["ssh_client"]
if "ssher" in node:
del clear_node["ssher"]
clear_node = {}
for node_param in node:
if node_param == "ssh_client" or node_param == "ssher":
continue
clear_node[node_param] = node[node_param]
tasks.append(GatherLogOnNode(new_context, clear_node, self.gather_log_conf_dict, semaphore))
else:
tasks.append(GatherLogOnNode(new_context, node, self.gather_log_conf_dict, semaphore))
Expand All @@ -255,6 +255,7 @@ def handle(self):
with open(os.path.join(self.store_dir, "result_summary.txt"), 'a', encoding='utf-8') as fileobj:
fileobj.write(summary_tuples.get_string())
except Exception as e:
self.stdio.exception(e)
self.stdio.verbose("gather log error: {0}".format(e))
finally:
self.stdio.stop_loading("succeed")
Expand Down
4 changes: 3 additions & 1 deletion src/handler/rca/rca_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,11 @@ def __init__(self, context):
self.scene = Util.get_option(self.context.options, "scene")
self.version = "unknown"
try:
if self.context.get_variable("ob_cluster").get("db_host") is not None or len(self.context.cluster_config.get("servers")) > 0:
ob_cluster = self.context.get_variable("ob_cluster")
if ob_cluster is not None and ob_cluster.get("db_host") is not None and len(self.context.cluster_config.get("servers")) > 0:
self.version = get_version_by_type(self.context, "observer")
except Exception as e:
self.stdio.exception(e)
self.stdio.verbose("rca get obcluster version fail. Maybe the scene need not it, skip it. Exception: {0}".format(e))
self.stdio.warn("rca get obcluster version fail. if the scene need not it, skip it")

Expand Down

0 comments on commit 0c7f21e

Please sign in to comment.