From 2a6b105b8ae9cb63702d83461560e65b7fabd085 Mon Sep 17 00:00:00 2001 From: Adam King Date: Wed, 31 Jul 2024 13:30:02 -0400 Subject: [PATCH] mgr/cephadm: make nvme-gw adds be able to handle multiple services/groups Before this was grabbing the service spec for the first daemon description in the list. This meant every daemon would be added with the pool/group of whatever that spec happened to specify. This patch grabs the spec, and therefore also the pool/group individually for each nvmeof daemon Signed-off-by: Adam King --- src/pybind/mgr/cephadm/services/nvmeof.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/pybind/mgr/cephadm/services/nvmeof.py b/src/pybind/mgr/cephadm/services/nvmeof.py index 2fb4502ef4f7e..5ba966231d257 100644 --- a/src/pybind/mgr/cephadm/services/nvmeof.py +++ b/src/pybind/mgr/cephadm/services/nvmeof.py @@ -92,14 +92,14 @@ class NvmeofService(CephService): """ Overrides the daemon_check_post to add nvmeof gateways safely """ self.mgr.log.info(f"nvmeof daemon_check_post {daemon_descrs}") - spec = cast(NvmeofServiceSpec, - self.mgr.spec_store.all_specs.get(daemon_descrs[0].service_name(), None)) - if not spec: - self.mgr.log.error(f'Failed to find spec for {daemon_descrs[0].name()}') - return - pool = spec.pool - group = spec.group for dd in daemon_descrs: + spec = cast(NvmeofServiceSpec, + self.mgr.spec_store.all_specs.get(dd.service_name(), None)) + if not spec: + self.mgr.log.error(f'Failed to find spec for {dd.name()}') + return + pool = spec.pool + group = spec.group # Notify monitor about this gateway creation cmd = { 'prefix': 'nvme-gw create', -- 2.39.5