# Open a connection to bugzilla.
self.bugzilla = bugtracker.Bugzilla(self)
+ # Create a temporary directory
+ self._create_tmp_path()
+
log.info("Pakfire Build Service initialized at %s" % self.basepath)
def read_config(self, path):
return database.Connection(hostname, name, user=user, password=password)
+ def _create_tmp_path(self):
+ """
+ This function will create some temporary space with the correct permissions.
+ """
+ path = self.path("tmp")
+
+ try:
+ os.mkdir(path, mode=0o1777)
+
+ # Ignore if the directory already exists
+ except FileExistsError:
+ pass
+
def path(self, *args):
"""
Takes a relative path and makes it absolute
"""
Tests whether the unlink() function works correctly
"""
- path = self.backend.path("tmp/file")
+ path = self.backend.path("tmp/parent/file")
# Fetch the parent directory
parent = os.path.dirname(path)