Skip to content

Commit 1e710ac

Browse files
committed
mgr/cephadm: fix error handling in deploy_given_daemons
In the case where _create_daemon just returns an exception itself, which should only happen in the case deployment fails in general rather than for a specific daemon, (can happen if the host it wants to deploy on has gone offline for example) deploy_given_daemons was not properly handling the exception and instead referenced the unbound variable "failures". Signed-off-by: Adam King <[email protected]> (cherry picked from commit f0207ca) Resolves: rhbz#2371418
1 parent 867d498 commit 1e710ac

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/pybind/mgr/cephadm/serve.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1160,6 +1160,8 @@ async def deploy_given_daemons(self, to_deploy: List[CephadmDaemonDeploySpec]) -
11601160
# deployment of an individual daemon
11611161
msg = (f"Failed while placing {daemon_names} "
11621162
f"on {hostname}: {e}")
1163+
self.mgr.log.error(msg)
1164+
return (False, set(), [msg])
11631165
for daemon_name, msg in failures.items():
11641166
# these are failures specific to a particular daemon
11651167
daemon_spec = [d for d in to_deploy if d.name() == daemon_name][0]

0 commit comments

Comments
 (0)