From: Michael Tremer Date: Thu, 6 Oct 2022 13:39:23 +0000 (+0000) Subject: backend: Allow creating Pakfire instances without any configuration X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=6d21af88239b55f519616248eb10bcb25cbb638a;p=pbs.git backend: Allow creating Pakfire instances without any configuration Signed-off-by: Michael Tremer --- 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