From: Kefu Chai Date: Tue, 19 May 2020 11:09:26 +0000 (+0800) Subject: qa/tasks/cephadm: ignore tarfile.ReadError X-Git-Tag: v15.2.4~73^2~6 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c6d2275f27f3b20e8d673b4361f4407b2f5ea4cf;p=ceph.git qa/tasks/cephadm: ignore tarfile.ReadError 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 (cherry picked from commit d67b0f1e3ac12d2b38ab6455b5311bcb051acb05) --- diff --git a/qa/tasks/cephadm.py b/qa/tasks/cephadm.py index 01fe4e800e7..0c01b836e9e 100644 --- a/qa/tasks/cephadm.py +++ b/qa/tasks/cephadm.py @@ -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):