diff --git a/conda-store-server/conda_store_server/app.py b/conda-store-server/conda_store_server/app.py index ce7710981..2381f3943 100644 --- a/conda-store-server/conda_store_server/app.py +++ b/conda-store-server/conda_store_server/app.py @@ -1,6 +1,7 @@ import os import sys import datetime +from pathlib import Path, PosixPath from typing import Any, Dict from celery import Celery, group @@ -88,7 +89,7 @@ class CondaStore(LoggingConfigurable): ) store_directory = Unicode( - "conda-store-state", + str(Path.home() / ".conda-store" / "conda-store-state"), help="directory for conda-store to build environments and store state", config=True, ) @@ -201,7 +202,7 @@ class CondaStore(LoggingConfigurable): ) database_url = Unicode( - "sqlite:///conda-store.sqlite", + "sqlite:///" + str(PosixPath.home()) + "/.conda-store/conda-store.sqlite", help="url for the database. e.g. 'sqlite:///conda-store.sqlite' tables will be automatically created if they do not exist", config=True, ) diff --git a/conda-store-server/conda_store_server/server/app.py b/conda-store-server/conda_store_server/server/app.py index 741a31d26..13807b44a 100644 --- a/conda-store-server/conda_store_server/server/app.py +++ b/conda-store-server/conda_store_server/server/app.py @@ -183,6 +183,8 @@ def initialize(self, *args, **kwargs): self.conda_store = CondaStore(parent=self, log=self.log) + self.conda_store.ensure_directories() + if self.conda_store.upgrade_db: dbutil.upgrade(self.conda_store.database_url)