From: Kefu Chai Date: Tue, 19 May 2020 11:09:26 +0000 (+0800) Subject: qa/tasks/cephadm: ignore tarfile.ReadError X-Git-Tag: v16.1.0~2293^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F35125%2Fhead;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 --- diff --git a/qa/tasks/cephadm.py b/qa/tasks/cephadm.py index af542c4549076..f49afcc9e6b59 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):