]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: Handled cephadm binary creation with different ssh user
authorShweta Bhosale <Shweta.Bhosale1@ibm.com>
Mon, 20 Apr 2026 04:37:47 +0000 (10:07 +0530)
committerShweta Bhosale <Shweta.Bhosale1@ibm.com>
Thu, 11 Jun 2026 05:10:34 +0000 (10:40 +0530)
Since we execute the cephadm binary directly with sudo,
we get exit code 1 with a “command not found” error if the binary does not exist.
Handled it in run_cephadm to generate cephadm binary in this case.

Fixes: https://tracker.ceph.com/issues/74045
Signed-off-by: Shweta Bhosale <Shweta.Bhosale1@ibm.com>
src/pybind/mgr/cephadm/serve.py

index 0f28494239863cb2ded2e8ff375b342f66c0bad0..71ae061cda6478e650e4e31ddefb191c33f7dfab 100644 (file)
@@ -1801,7 +1801,7 @@ class CephadmServe:
             try:
                 out, err, code = await self.mgr.ssh._execute_command(
                     host, cmd, stdin=stdin, addr=addr)
-                if code == 2 or code == 127:
+                if code == 2 or code == 127 or 'command not found' in err:
                     # Use invoker to check file existence when SSH hardening is enabled
                     if self.mgr.sudo_hardening and self.mgr.invoker_path:
                         check_cmd = ssh.RemoteCommand(