Skip to content

Commit

Permalink
Fix: bootstrap: Local joining node should be included when merging kn…
Browse files Browse the repository at this point in the history
…own_hosts (bsc#1229419)

Otherwise, the local joining node's known_hosts entry will not be synced
to the other nodes.
  • Loading branch information
liangxin1300 committed Dec 22, 2024
1 parent 562ce84 commit fa9a948
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crmsh/bootstrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -1748,7 +1748,7 @@ def join_ssh_merge(cluster_node, remote_user):
"""
logger.info("Merging known_hosts")

hosts = _context.node_list_in_cluster
hosts = _context.node_list_in_cluster + [utils.this_node()]

shell = sh.cluster_shell()
# create local entry in known_hosts
Expand All @@ -1757,7 +1757,6 @@ def join_ssh_merge(cluster_node, remote_user):
known_hosts_new: set[str] = set()

cat_cmd = "[ -e ~/.ssh/known_hosts ] && cat ~/.ssh/known_hosts || true"
#logger_utils.log_only_to_file("parallax.call {} : {}".format(hosts, cat_cmd))
for host in hosts:
known_hosts_content = shell.get_stdout_or_raise_error(cat_cmd, host)
if known_hosts_content:
Expand Down

0 comments on commit fa9a948

Please sign in to comment.