From 6d21af88239b55f519616248eb10bcb25cbb638a Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Thu, 6 Oct 2022 13:39:23 +0000 Subject: [PATCH] backend: Allow creating Pakfire instances without any configuration Signed-off-by: Michael Tremer --- src/buildservice/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/buildservice/__init__.py b/src/buildservice/__init__.py index d2168f46..d2af2bae 100644 --- a/src/buildservice/__init__.py +++ b/src/buildservice/__init__.py @@ -146,7 +146,7 @@ class Backend(object): # Join it all together return urllib.parse.urljoin(baseurl, path) - def pakfire(self, config, offline=True, **kwargs): + def pakfire(self, config=None, offline=True, **kwargs): """ Launches a new Pakfire instance with the given configuration """ @@ -298,7 +298,10 @@ class Backend(object): t = tempfile.NamedTemporaryFile(delete=False) # Write the content - t.write(content.encode()) + if content: + t.write(content.encode()) + + # Close the file t.close() return t.name -- 2.47.2