]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: execute conf update when rotating secret
authorRadoslaw Zarzynski <rzarzyns@redhat.com>
Thu, 18 Aug 2022 11:02:41 +0000 (11:02 +0000)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Wed, 14 Sep 2022 16:15:59 +0000 (16:15 +0000)
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>
(cherry picked from commit e9b96417a19cf95857ca9ff97b87bca30e1f30ca)

src/pybind/mgr/cephadm/module.py

index 9a87fc6626fa513298148f39161e1656a7e35a38..ecfec020409b707c9ccf0f6f182435835559655c 100644 (file)
@@ -1954,7 +1954,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