diff --git a/requirements.txt b/requirements.txt --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ +PyYAML aiosqlite psutil pyfuse3 diff --git a/swh/fuse/cli.py b/swh/fuse/cli.py --- a/swh/fuse/cli.py +++ b/swh/fuse/cli.py @@ -28,9 +28,9 @@ DEFAULT_CONFIG: Dict[str, Any] = { "cache": { - "metadata": {"path": CACHE_HOME_DIR / "swh/fuse/metadata.sqlite"}, - "blob": {"path": CACHE_HOME_DIR / "swh/fuse/blob.sqlite"}, - "history": {"path": CACHE_HOME_DIR / "swh/fuse/history.sqlite"}, + "metadata": {"path": str(CACHE_HOME_DIR / "swh/fuse/metadata.sqlite")}, + "blob": {"path": str(CACHE_HOME_DIR / "swh/fuse/blob.sqlite")}, + "history": {"path": str(CACHE_HOME_DIR / "swh/fuse/history.sqlite")}, "direntry": {"maxram": "10%"}, }, "web-api": { @@ -53,7 +53,8 @@ """Software Heritage virtual file system""" import logging - import pprint + + import yaml from swh.core import config @@ -61,7 +62,6 @@ config_file = DEFAULT_CONFIG_PATH try: - logging.info("Loading configuration from: %s", config_file) conf = config.read_raw_config(config.config_basepath(config_file)) if not conf: raise ValueError(f"Cannot parse configuration file: {config_file}") @@ -74,11 +74,13 @@ # recursive merge not done by config.read conf = config.merge_configs(DEFAULT_CONFIG, conf) - except Exception as err: - logging.warning("Using default configuration (cannot load custom one: %s)", err) + except Exception: + logging.warning( + "Using default configuration (cannot load custom one)", exc_info=True + ) conf = DEFAULT_CONFIG - logging.info("Read configuration: \n%s", pprint.pformat(conf)) + logging.debug("Read configuration: \n%s", yaml.dump(conf)) ctx.ensure_object(dict) ctx.obj["config"] = conf