mirror of
https://github.com/ansible-collections/community.general.git
synced 2024-09-14 20:13:21 +02:00
fix archive module can not compress a single file in a tar file (#45117)
fixes #44968
This commit is contained in:
parent
87a9ada188
commit
95718f7e12
1 changed files with 4 additions and 1 deletions
|
@ -426,7 +426,10 @@ def main():
|
||||||
arcfile.write(path, path[len(arcroot):])
|
arcfile.write(path, path[len(arcroot):])
|
||||||
arcfile.close()
|
arcfile.close()
|
||||||
state = 'archive' # because all zip files are archives
|
state = 'archive' # because all zip files are archives
|
||||||
|
elif format == 'tar':
|
||||||
|
arcfile = tarfile.open(dest, 'w')
|
||||||
|
arcfile.add(path)
|
||||||
|
arcfile.close()
|
||||||
else:
|
else:
|
||||||
f_in = open(path, 'rb')
|
f_in = open(path, 'rb')
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue