]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph cephadm set-user does not reflect the user change in ssh-config 45796/head
authorTeoman ONAY <tonay@redhat.com>
Wed, 6 Apr 2022 09:32:17 +0000 (11:32 +0200)
committerTeoman ONAY <tonay@redhat.com>
Mon, 11 Apr 2022 12:38:04 +0000 (14:38 +0200)
Fixes: https://tracker.ceph.com/issues/54618
Signed-off-by: Teoman ONAY <tonay@redhat.com>
src/pybind/mgr/cephadm/module.py

index bad299579033fef3f2e229d06bb5195493284240..d386f09a7895bcaea6e02c6aeef417b24d9010f2 100644 (file)
@@ -979,6 +979,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':