]> git.apps.os.sepia.ceph.com Git - teuthology.git/commitdiff
task.internal: Skip coredump on containers
authorZack Cerza <zack@redhat.com>
Mon, 17 Jan 2022 20:38:41 +0000 (13:38 -0700)
committerZack Cerza <zack@redhat.com>
Fri, 4 Mar 2022 23:25:09 +0000 (16:25 -0700)
Signed-off-by: Zack Cerza <zack@redhat.com>
teuthology/task/internal/__init__.py

index a35186e13fd9ad41348a060dc45f4d9c53d44898..d85b3f212e0994d51c7001e959ca7c7f4478c141 100644 (file)
@@ -444,9 +444,10 @@ def coredump(ctx, config):
     Stash a coredump of this system if an error occurs.
     """
     log.info('Enabling coredump saving...')
+    cluster = ctx.cluster.filter(lambda r: not r.is_container)
     archive_dir = misc.get_archive_dir(ctx)
     run.wait(
-        ctx.cluster.run(
+        cluster.run(
             args=[
                 'install', '-d', '-m0755', '--',
                 '{adir}/coredump'.format(adir=archive_dir),
@@ -465,8 +466,9 @@ def coredump(ctx, config):
     try:
         yield
     finally:
+        cluster = ctx.cluster.filter(lambda r: not r.is_container)
         run.wait(
-            ctx.cluster.run(
+            cluster.run(
                 args=[
                     'sudo', 'sysctl', '-w', 'kernel.core_pattern=core',
                     run.Raw('&&'),
@@ -487,7 +489,7 @@ def coredump(ctx, config):
 
         # set status = 'fail' if the dir is still there = coredumps were
         # seen
-        for rem in ctx.cluster.remotes.keys():
+        for rem in cluster.remotes.keys():
             try:
                 rem.sh("test -e " + archive_dir + "/coredump")
             except run.CommandFailedError: