From c4c01534c8b9a4b3d2700e99195538424def781b Mon Sep 17 00:00:00 2001 From: nicholasyang Date: Mon, 23 Oct 2023 11:51:23 +0800 Subject: [PATCH] fix chsh hacluster in cluster init -N --- crmsh/bootstrap.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crmsh/bootstrap.py b/crmsh/bootstrap.py index 9bf1c9ba24..86a2344f3e 100644 --- a/crmsh/bootstrap.py +++ b/crmsh/bootstrap.py @@ -887,8 +887,7 @@ def init_ssh_impl(local_user: str, ssh_public_keys: typing.List[ssh_key.Key], us for user, node in user_node_list: user_by_host.add(user, node) user_by_host.add(local_user, utils.this_node()) - for user, node in user_node_list: - change_user_shell('hacluster', node) + user_by_host.save_local() # Starting from here, ClusterShell is available shell = sh.ClusterShell(local_shell, UserOfHost.instance()) authorized_key_manager = ssh_key.AuthorizedKeyManager(shell) @@ -897,7 +896,9 @@ def init_ssh_impl(local_user: str, ssh_public_keys: typing.List[ssh_key.Key], us [node for user, node in user_node_list], 'hacluster', ) - user_by_host.save_remote([node for user, node in user_node_list]) + for user, node in user_node_list: + change_user_shell('hacluster', node) + user_by_host.save_remote([node for user, node in user_node_list]) def _init_ssh_on_remote_nodes(