]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/cephadm: fixing logging output for rm-cluster operation
authorRedouane Kachach <rkachach@redhat.com>
Mon, 18 Apr 2022 13:42:39 +0000 (15:42 +0200)
committerAdam King <adking@redhat.com>
Tue, 3 May 2022 00:48:33 +0000 (20:48 -0400)
Fixes: https://tracker.ceph.com/issues/51671
Signed-off-by: Redouane Kachach <rkachach@redhat.com>
(cherry picked from commit 9756e3bf8ce6976d12245e1e6724838b03d70135)

src/cephadm/cephadm

index fd7cd562a3a29c71576e4054e7d7a92e7716a4c4..71dccb7babc54b76a70a4f6eff8ca6109e745883 100755 (executable)
@@ -281,10 +281,10 @@ class ExcludeErrorsFilter(logging.Filter):
         return record.levelno < logging.WARNING
 
 
-# During bootstrap operation we use:
+# When cephadm is used as standard binary (bootstrap, rm-cluster, etc) we use:
 # stdout: for debug and info
 # stderr: for errors and warnings
-bootstrap_logging_config = {
+interactive_logging_config = {
     'version': 1,
     'filters': {
         'exclude_errors': {
@@ -8879,8 +8879,9 @@ def cephadm_init_logging(ctx: CephadmContext, args: List[str]) -> None:
     global logger
     if not os.path.exists(LOG_DIR):
         os.makedirs(LOG_DIR)
-    if 'bootstrap' in args:
-        dictConfig(bootstrap_logging_config)
+    operations = ['bootstrap', 'rm-cluster']
+    if any(op in args for op in operations):
+        dictConfig(interactive_logging_config)
     else:
         dictConfig(logging_config)