From 49d8d5ae3362c3eb32afdf4b1b4698b0681b9ffb Mon Sep 17 00:00:00 2001 From: Matt Clay Date: Wed, 29 Jan 2020 18:21:49 -0800 Subject: [PATCH] Fix ansible-test tar format handling. --- changelogs/fragments/ansible-test-remote-tar-format.yml | 2 ++ test/lib/ansible_test/_internal/payload.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/ansible-test-remote-tar-format.yml diff --git a/changelogs/fragments/ansible-test-remote-tar-format.yml b/changelogs/fragments/ansible-test-remote-tar-format.yml new file mode 100644 index 00000000000..b6155f785bc --- /dev/null +++ b/changelogs/fragments/ansible-test-remote-tar-format.yml @@ -0,0 +1,2 @@ +bugfixes: + - ansible-test now uses GNU tar format instead of the Python default when creating payloads for remote systems diff --git a/test/lib/ansible_test/_internal/payload.py b/test/lib/ansible_test/_internal/payload.py index 0a6754f5134..9a6b557b2e0 100644 --- a/test/lib/ansible_test/_internal/payload.py +++ b/test/lib/ansible_test/_internal/payload.py @@ -97,7 +97,7 @@ def create_payload(args, dst_path): # type: (CommonConfig, str) -> None start = time.time() - with tarfile.TarFile.gzopen(dst_path, mode='w', compresslevel=4) as tar: + with tarfile.TarFile.open(dst_path, mode='w:gz', compresslevel=4, format=tarfile.GNU_FORMAT) as tar: for src, dst in files: display.info('%s -> %s' % (src, dst), verbosity=4) tar.add(src, dst, filter=filters.get(dst))