]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
qa/tasks/cephadm: ignore tarfile.ReadError 35125/head
authorKefu Chai <kchai@redhat.com>
Tue, 19 May 2020 11:09:26 +0000 (19:09 +0800)
committerKefu Chai <kchai@redhat.com>
Tue, 19 May 2020 11:10:56 +0000 (19:10 +0800)
there is chance that /var/log/ceph (and other directories) is not
created when cephadm fails, but we always try to collect /var/log/ceph
by tar the directory on the test node and transfer it back for archiving
it. when we fail to do so, an exception is thrown, and this exception is
in turn logged as the cause of the failure instead of the one which
fails the test.

in this change, `tarfile.TarError`s is caught and ignored if it is
thrown by `misc.pull_directory()`, as normally, we don't consider it a fatal
failure when `misc.pull_directory()` fails because of `tar`. the
failures for the test are.

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

index af542c4549076123fda38f1cbcf2d7980e9874df..f49afcc9e6b59a2ff303e5732ff7f325904f96f1 100644 (file)
@@ -250,8 +250,11 @@ def ceph_log(ctx, config):
                     os.makedirs(sub)
                 except OSError:
                     pass
-                teuthology.pull_directory(remote, '/var/log/ceph',  # everything
-                                          os.path.join(sub, 'log'))
+                try:
+                    teuthology.pull_directory(remote, '/var/log/ceph',  # everything
+                                              os.path.join(sub, 'log'))
+                except ReadError:
+                    pass
 
 @contextlib.contextmanager
 def ceph_crash(ctx, config):