Commit b02471cd authored by Rafael Monnerat's avatar Rafael Monnerat

slapos/collect: Check if directory exists before continue

parent 2baa2125
......@@ -123,6 +123,9 @@ class Database:
def __init__(self, directory = None, create = True, timeout=None):
assert self.database_name is not None
if directory.endswith(self.database_name):
directory = directory[:-len(self.database_name)]
assert os.path.exists(directory)
self.uri = os.path.join(directory, self.database_name)
self.connection = None
self.cursor = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment