mirror of
https://github.com/ansible-collections/community.general.git
synced 2025-07-25 14:20:22 -07:00
fix: Ensure zip excluded files are not checked (#40120)
* fix: Ensure zip excluded files are not checked Fixes #26279 * test: Verify unarchive excludes behaves as expected * fix: Typos and whitespaces
This commit is contained in:
parent
8414230266
commit
529ef6446e
2 changed files with 34 additions and 14 deletions
|
@ -132,6 +132,7 @@ EXAMPLES = r'''
|
|||
import binascii
|
||||
import codecs
|
||||
import datetime
|
||||
import fnmatch
|
||||
import grp
|
||||
import os
|
||||
import platform
|
||||
|
@ -263,7 +264,11 @@ class ZipArchive(object):
|
|||
else:
|
||||
try:
|
||||
for member in archive.namelist():
|
||||
if member not in self.excludes:
|
||||
if self.excludes:
|
||||
for exclude in self.excludes:
|
||||
if not fnmatch.fnmatch(member, exclude):
|
||||
self._files_in_archive.append(to_native(member))
|
||||
else:
|
||||
self._files_in_archive.append(to_native(member))
|
||||
except:
|
||||
archive.close()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue