From e79120278d988825dea1dded183be5c4d0b43e36 Mon Sep 17 00:00:00 2001 From: soksanichenko Date: Sun, 1 May 2022 03:32:01 +0300 Subject: [PATCH] ALBS-334: Make the ability of Pungi to give module_defaults from remote sources --- pungi/scripts/create_packages_json.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pungi/scripts/create_packages_json.py b/pungi/scripts/create_packages_json.py index f4143453..977b44a2 100644 --- a/pungi/scripts/create_packages_json.py +++ b/pungi/scripts/create_packages_json.py @@ -44,6 +44,7 @@ def is_xz_file(first_two_bytes): initial_bytes=b'fd37', ) + @dataclass class RepoInfo: # path to a directory with repo directories. E.g. '/var/repos' contains @@ -97,7 +98,7 @@ class PackagesGenerator: url=file_url, ) file_request.raise_for_status() - with tempfile.NamedTemporaryFile(delete=False) as file_stream: + with tempfile.NamedTemporaryFile(delete=True) as file_stream: file_stream.write(file_request.content) return file_stream.name