From e720ba887ca3a6b67dcc56a3506408272fa155f6 Mon Sep 17 00:00:00 2001 From: Sebastian Wagner Date: Wed, 21 Jul 2021 11:46:16 +0200 Subject: [PATCH] cephadm: don't log on exit. At this point, the garbage collector already colleceted the `open` function Signed-off-by: Sebastian Wagner (cherry picked from commit 71162c6fea7aba2e30cf50d8a0f1a5a0cf3b2462) --- src/cephadm/cephadm | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/cephadm/cephadm b/src/cephadm/cephadm index 1182bddd6b471..12a99b5268f38 100755 --- a/src/cephadm/cephadm +++ b/src/cephadm/cephadm @@ -1205,13 +1205,16 @@ class FileLock(object): self._lock_counter -= 1 if self._lock_counter == 0 or force: - lock_id = id(self) - lock_filename = self._lock_file + # lock_id = id(self) + # lock_filename = self._lock_file - logger.debug('Releasing lock %s on %s', lock_id, lock_filename) + # Can't log in shutdown: + # File "/usr/lib64/python3.9/logging/__init__.py", line 1175, in _open + # NameError: name 'open' is not defined + # logger.debug('Releasing lock %s on %s', lock_id, lock_filename) self._release() self._lock_counter = 0 - logger.debug('Lock %s released on %s', lock_id, lock_filename) + # logger.debug('Lock %s released on %s', lock_id, lock_filename) return None -- 2.39.5