]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/ceph.py: do not use option mimic does not understand 34884/head
authorKefu Chai <kchai@redhat.com>
Sat, 2 May 2020 15:54:44 +0000 (23:54 +0800)
committerKefu Chai <kchai@redhat.com>
Sun, 3 May 2020 04:11:42 +0000 (12:11 +0800)
mimic does not have `mon-client-directed-command-retry` option, so we
should not pass this option to a mimic ceph client.

in this change, we fall back to plain retry, if command fails. this
change is not cherry-picked from master. as we don't run upgrade test
from mimic to master.

Signed-off-by: Kefu Chai <kchai@redhat.com>
qa/tasks/ceph.py

index aa4c9620fdc52dd75f54eee158bde0b20caeaabb..219c22c6c745874b4a65dfdaa1edb5fdd88b86a7 100644 (file)
@@ -1680,6 +1680,25 @@ def validate_config(ctx, config):
             last_role = role
 
 
+def stop_logging_health(remote, cluster, retry):
+    # try this several times, since tell to mons is lossy.
+    args = 'sudo ceph --cluster {cluster} {retry_opts} tell mon.* injectargs -- --no-mon-health-to-clog'
+    try:
+        retry_opts = '--mon-client-directed-command-retry {}'.format(retry)
+        remote.run(
+            args=args.format(cluster=cluster,
+                             retry_opts=retry_opts))
+    except run.CommandFailedError:
+        for i in range(retry):
+            try:
+                remote.run(
+                    args=args.format(cluster=cluster,
+                                     retry_opts=''))
+                return
+            except run.CommandFailedError:
+                pass
+
+
 @contextlib.contextmanager
 def task(ctx, config):
     """
@@ -1886,17 +1905,4 @@ def task(ctx, config):
             # a bunch of scary messages unrelated to our actual run.
             firstmon = teuthology.get_first_mon(ctx, config, config['cluster'])
             (mon0_remote,) = ctx.cluster.only(firstmon).remotes.keys()
-            # try this several times, since tell to mons is lossy.
-            mon0_remote.run(
-                args=[
-                    'sudo',
-                    'ceph',
-                    '--cluster', config['cluster'],
-                    '--mon-client-directed-command-retry', '5',
-                    'tell',
-                    'mon.*',
-                    'injectargs',
-                    '--',
-                    '--no-mon-health-to-clog',
-                ]
-            )
+            stop_logging_health(mon0_remote, config['cluster'], 5)