This is a fixup for: mgr/cephadm: add daemon 'rotate-key' action
The way we rotate mgr's secret require:
1) writing the new pending-key to mgr's file,
2) restarting the mgr via the `mgr fail` mon command.
Unfortunately, we might be doing the first step wrongly.
`_create_daemoan()` is a coroutine (Python's `async def`)
while we don't `wait` for it. IIUC the underlying doc
correctly, this has no effect, and thus the mgr is restarted
with old key.
"Note that simply calling a coroutine will not schedule
it to be executed"
See: https://docs.python.org/3/library/asyncio-task.html#id1
Signed-off-by: Radoslaw Zarzynski <rzarzyns@redhat.com>
if daemon_spec.daemon_type != 'osd':
daemon_spec = self.cephadm_services[daemon_type_to_service(
daemon_spec.daemon_type)].prepare_create(daemon_spec)
- CephadmServe(self)._create_daemon(daemon_spec, reconfig=True)
+ self.wait_async(CephadmServe(self)._create_daemon(daemon_spec, reconfig=True))
# try to be clever, or fall back to restarting the daemon
rc = -1