From e9b96417a19cf95857ca9ff97b87bca30e1f30ca Mon Sep 17 00:00:00 2001 From: Radoslaw Zarzynski Date: Thu, 18 Aug 2022 11:02:41 +0000 Subject: [PATCH] mgr/cephadm: execute conf update when rotating secret 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 --- src/pybind/mgr/cephadm/module.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pybind/mgr/cephadm/module.py b/src/pybind/mgr/cephadm/module.py index e22ed6ede80..0ff44e43544 100644 --- a/src/pybind/mgr/cephadm/module.py +++ b/src/pybind/mgr/cephadm/module.py @@ -2003,7 +2003,7 @@ Then run the following: 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 -- 2.39.5