]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: add logging to service_discovery condition 64416/head
authorJohn Mulligan <jmulligan@redhat.com>
Fri, 20 Jun 2025 14:17:51 +0000 (10:17 -0400)
committerAdam King <adking@redhat.com>
Wed, 9 Jul 2025 15:52:24 +0000 (11:52 -0400)
Add a logger to service_discovery.py because a "typical" logger
was not present and use the logger to capture the hopefully
rare condition that service spec was not present for a daemon.

Signed-off-by: John Mulligan <jmulligan@redhat.com>
(cherry picked from commit 17668d5612f1cc1203a00edd5a8ec98c65241680)

src/pybind/mgr/cephadm/service_discovery.py

index ff877e59defeb60b6e6c243d7d2d3955d4890482..cddddcd3b088d2630e7d2171410acbf2e9684975 100644 (file)
@@ -38,6 +38,7 @@ def cherrypy_filter(record: logging.LogRecord) -> bool:
 
 logging.getLogger('cherrypy.error').addFilter(cherrypy_filter)
 cherrypy.log.access_log.propagate = False
+logger = logging.getLogger(__name__)
 
 
 class Route(NamedTuple):
@@ -280,7 +281,7 @@ class Root(Server):
             try:
                 spec = cast(SMBSpec, self.mgr.spec_store[dd.service_name()].spec)
             except KeyError:
-                # TODO: logging
+                logger.warning("no spec found for %s", dd.service_name())
                 continue
             # TODO: needs updating once ip control/colocation is present
             addr = dd.ip if dd.ip else self.mgr.inventory.get_addr(dd.hostname)