]> git.ipfire.org Git - pbs.git/commitdiff
backend: Allow creating Pakfire instances without any configuration
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 6 Oct 2022 13:39:23 +0000 (13:39 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 6 Oct 2022 13:39:23 +0000 (13:39 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/buildservice/__init__.py

index d2168f46b017a6b199ee7776f49e3c6bfe8d6233..d2af2bae99842e525b3f113208b66e2cd954878c 100644 (file)
@@ -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