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>
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(