]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
cephadm: use debug verbosity during container exec 40241/head
authorMichael Fritch <mfritch@suse.com>
Thu, 18 Mar 2021 21:41:06 +0000 (15:41 -0600)
committerMichael Fritch <mfritch@suse.com>
Fri, 19 Mar 2021 14:15:24 +0000 (08:15 -0600)
avoid failures from appearing on the consle when exec'ing within the
container during the `ls` command

Signed-off-by: Michael Fritch <mfritch@suse.com>
src/cephadm/cephadm

index 75be85f3c6dd27795861a44b907b27da0bee4d00..38e5d39e8388639abac33af5ed3e54953b07fef9 100755 (executable)
@@ -289,14 +289,14 @@ class Monitoring(object):
                 _, err, code = call(ctx, [
                     ctx.container_path, 'exec', container_id, cmd,
                     '--version'
-                ], verbosity=CallVerbosity.SILENT)
+                ], verbosity=CallVerbosity.DEBUG)
                 if code == 0:
                     break
             cmd = 'alertmanager'  # reset cmd for version extraction
         else:
             _, err, code = call(ctx, [
                 ctx.container_path, 'exec', container_id, cmd, '--version'
-            ])
+            ], verbosity=CallVerbosity.DEBUG)
         if code == 0 and \
                 err.startswith('%s, version ' % cmd):
             version = err.split(' ')[2]
@@ -386,7 +386,8 @@ class NFSGanesha(object):
         version = None
         out, err, code = call(ctx,
                               [ctx.container_path, 'exec', container_id,
-                               NFSGanesha.entrypoint, '-v'])
+                               NFSGanesha.entrypoint, '-v'],
+                              verbosity=CallVerbosity.DEBUG)
         if code == 0:
             match = re.search(r'NFS-Ganesha Release\s*=\s*[V]*([\d.]+)', out)
             if match:
@@ -547,7 +548,8 @@ class CephIscsi(object):
         version = None
         out, err, code = call(ctx,
                               [ctx.container_path, 'exec', container_id,
-                               '/usr/bin/python3', '-c', "import pkg_resources; print(pkg_resources.require('ceph_iscsi')[0].version)"])
+                               '/usr/bin/python3', '-c', "import pkg_resources; print(pkg_resources.require('ceph_iscsi')[0].version)"],
+                              verbosity=CallVerbosity.DEBUG)
         if code == 0:
             version = out.strip()
         return version
@@ -4596,7 +4598,9 @@ def list_daemons(ctx, detail=True, legacy_dir=None):
                             check_unit(ctx, legacy_unit_name)
                         if not host_version:
                             try:
-                                out, err, code = call(ctx, ['ceph', '-v'])
+                                out, err, code = call(ctx,
+                                                      ['ceph', '-v'],
+                                                      verbosity=CallVerbosity.DEBUG)
                                 if not code and out.startswith('ceph version '):
                                     host_version = out.split(' ')[2]
                             except Exception:
@@ -4669,7 +4673,8 @@ def list_daemons(ctx, detail=True, legacy_dir=None):
                                 if daemon_type in Ceph.daemons:
                                     out, err, code = call(ctx,
                                                           [container_path, 'exec', container_id,
-                                                           'ceph', '-v'])
+                                                           'ceph', '-v'],
+                                                          verbosity=CallVerbosity.DEBUG)
                                     if not code and \
                                        out.startswith('ceph version '):
                                         version = out.split(' ')[2]
@@ -4677,7 +4682,8 @@ def list_daemons(ctx, detail=True, legacy_dir=None):
                                 elif daemon_type == 'grafana':
                                     out, err, code = call(ctx,
                                                           [container_path, 'exec', container_id,
-                                                           'grafana-server', '-v'])
+                                                           'grafana-server', '-v'],
+                                                          verbosity=CallVerbosity.DEBUG)
                                     if not code and \
                                        out.startswith('Version '):
                                         version = out.split(' ')[1]
@@ -4690,7 +4696,8 @@ def list_daemons(ctx, detail=True, legacy_dir=None):
                                 elif daemon_type == 'haproxy':
                                     out, err, code = call(ctx,
                                                           [container_path, 'exec', container_id,
-                                                           'haproxy', '-v'])
+                                                           'haproxy', '-v'],
+                                                          verbosity=CallVerbosity.DEBUG)
                                     if not code and \
                                        out.startswith('HA-Proxy version '):
                                         version = out.split(' ')[2]
@@ -4698,7 +4705,8 @@ def list_daemons(ctx, detail=True, legacy_dir=None):
                                 elif daemon_type == 'keepalived':
                                     out, err, code = call(ctx,
                                                           [container_path, 'exec', container_id,
-                                                           'keepalived', '--version'])
+                                                           'keepalived', '--version'],
+                                                          verbosity=CallVerbosity.DEBUG)
                                     if not code and \
                                        err.startswith('Keepalived '):
                                         version = err.split(' ')[1]