From e70203300a9a27e8e8bb35288152da4a48112631 Mon Sep 17 00:00:00 2001 From: Brian Coca Date: Wed, 10 Apr 2024 16:49:06 -0400 Subject: [PATCH] Unarchive get zipinfo on more OS/distros (#82873) (#82877) Not all implementations use -l as default for -Z on unzip (cherry picked from commit 481d8bdc1edae1a02f6201174fe344ac9fa8968a) --- changelogs/fragments/unarchive_fix.yml | 2 ++ lib/ansible/modules/unarchive.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/unarchive_fix.yml diff --git a/changelogs/fragments/unarchive_fix.yml b/changelogs/fragments/unarchive_fix.yml new file mode 100644 index 00000000000..dd5e35d7865 --- /dev/null +++ b/changelogs/fragments/unarchive_fix.yml @@ -0,0 +1,2 @@ +bugfixes: + - unarchive modules now uses zipinfo options without relying on implementation defaults, making it more compatible with all OS/distributions. diff --git a/lib/ansible/modules/unarchive.py b/lib/ansible/modules/unarchive.py index ec15a5717af..b3e8058a43d 100644 --- a/lib/ansible/modules/unarchive.py +++ b/lib/ansible/modules/unarchive.py @@ -969,7 +969,7 @@ class TarZstdArchive(TgzArchive): class ZipZArchive(ZipArchive): def __init__(self, src, b_dest, file_args, module): super(ZipZArchive, self).__init__(src, b_dest, file_args, module) - self.zipinfoflag = '-Z' + self.zipinfoflag = '-Zl' self.binaries = ( ('unzip', 'cmd_path'), ('unzip', 'zipinfo_cmd_path'),