]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph cephadm set-user does not reflect the user change in ssh-config
authorTeoman ONAY <tonay@redhat.com>
Wed, 6 Apr 2022 09:32:17 +0000 (11:32 +0200)
committerAdam King <adking@redhat.com>
Tue, 3 May 2022 00:48:33 +0000 (20:48 -0400)
Fixes: https://tracker.ceph.com/issues/54618
Signed-off-by: Teoman ONAY <tonay@redhat.com>
(cherry picked from commit 071f72a734ce207e5cb2ff6d3d996e45396f5c7a)

src/pybind/mgr/cephadm/module.py

index eacf83f978afd9f5d4aa362526d270bca74dc552..5ae3deda07f3840cfa69aa0354c90a52d8d0b5d1 100644 (file)
@@ -953,6 +953,9 @@ class CephadmOrchestrator(orchestrator.Orchestrator, MgrModule,
             return 0, "value unchanged", ""
 
         self._validate_and_set_ssh_val('ssh_user', user, current_user)
+        current_ssh_config = self._get_ssh_config()
+        new_ssh_config = re.sub(r"(\s{2}User\s)(.*)", r"\1" + user, current_ssh_config.stdout)
+        self._set_ssh_config(new_ssh_config)
 
         msg = 'ssh user set to %s' % user
         if user != 'root':