Skip to content
This repository has been archived by the owner on May 24, 2023. It is now read-only.

Commit

Permalink
Don't mess input archive with extracted files
Browse files Browse the repository at this point in the history
Save temp archive file to different location than extracted files

Signed-off-by: Martin Bašti <mbasti@redhat.com>
  • Loading branch information
MartinBasti committed Mar 27, 2019
1 parent 6da9b87 commit 1977b71
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions omps/api/v1/push.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def extract_zip_file_from_request(

validate_allowed_extension(uploaded_file.filename)

with NamedTemporaryFile('w', suffix='.zip', dir=target_dir) as tmpf:
with NamedTemporaryFile('w', suffix='.zip') as tmpf:
uploaded_file.save(tmpf.name)
_extract_zip_file(tmpf.name, target_dir,
max_uncompressed_size=max_uncompressed_size)
Expand All @@ -127,7 +127,7 @@ def extract_zip_file_from_koji(
:param max_uncompressed_size: size in Bytes how big data can be accepted
after uncompressing
"""
with NamedTemporaryFile('wb', suffix='.zip', dir=target_dir) as tmpf:
with NamedTemporaryFile('wb', suffix='.zip') as tmpf:
KOJI.download_manifest_archive(nvr, tmpf)
_extract_zip_file(tmpf.name, target_dir,
max_uncompressed_size=max_uncompressed_size)
Expand Down

0 comments on commit 1977b71

Please sign in to comment.