Skip to content

Commit 17668d5

Browse files
mgr/cephadm: add logging to service_discovery condition
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 <[email protected]>
1 parent e6b5940 commit 17668d5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/pybind/mgr/cephadm/service_discovery.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ def cherrypy_filter(record: logging.LogRecord) -> bool:
3838

3939
logging.getLogger('cherrypy.error').addFilter(cherrypy_filter)
4040
cherrypy.log.access_log.propagate = False
41+
logger = logging.getLogger(__name__)
4142

4243

4344
class Route(NamedTuple):
@@ -280,7 +281,7 @@ def smb_sd_config(self) -> List[Dict[str, Collection[str]]]:
280281
try:
281282
spec = cast(SMBSpec, self.mgr.spec_store[dd.service_name()].spec)
282283
except KeyError:
283-
# TODO: logging
284+
logger.warning("no spec found for %s", dd.service_name())
284285
continue
285286
# TODO: needs updating once ip control/colocation is present
286287
addr = dd.ip if dd.ip else self.mgr.inventory.get_addr(dd.hostname)

0 commit comments

Comments
 (0)