diff --git a/src/config/settings.py b/src/config/settings.py index 4fcbc83..6cf2ad5 100644 --- a/src/config/settings.py +++ b/src/config/settings.py @@ -1,5 +1,3 @@ -from pathlib import Path - from decouple import Choices, Csv, config from src.config.networks import NETWORKS @@ -28,7 +26,7 @@ obol_keystores_dir: str = config('OBOL_KEYSTORES_DIR', default='') obol_keystores_dir_template: str = config('OBOL_KEYSTORES_DIR_TEMPLATE', default='') -obol_cluster_lock_file = Path(config('OBOL_CLUSTER_LOCK_FILE'), default='') +obol_cluster_lock_file = config('OBOL_CLUSTER_LOCK_FILE', default='') obol_node_index: int | None = config( 'OBOL_NODE_INDEX', cast=lambda x: int(x) if x != '' else None, default='' diff --git a/src/validators/keystores/obol.py b/src/validators/keystores/obol.py index 65afed1..fafb502 100644 --- a/src/validators/keystores/obol.py +++ b/src/validators/keystores/obol.py @@ -60,6 +60,9 @@ async def load_from_dir(keystores_dir: Path, node_index: int) -> 'ObolKeystore': @staticmethod def load_cluster_lock() -> dict: + if not settings.obol_cluster_lock_file: + raise RuntimeError('OBOL_CLUSTER_LOCK_FILE must be set') + return json.load(open(settings.obol_cluster_lock_file, encoding='ascii')) @staticmethod