Skip to content

Commit 8e9fd40

Browse files
Fix obol_cluster_lock_file optional (#10)
1 parent 3ca9cbc commit 8e9fd40

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

src/config/settings.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
from pathlib import Path
2-
31
from decouple import Choices, Csv, config
42

53
from src.config.networks import NETWORKS
@@ -28,7 +26,7 @@
2826
obol_keystores_dir: str = config('OBOL_KEYSTORES_DIR', default='')
2927
obol_keystores_dir_template: str = config('OBOL_KEYSTORES_DIR_TEMPLATE', default='')
3028

31-
obol_cluster_lock_file = Path(config('OBOL_CLUSTER_LOCK_FILE'), default='')
29+
obol_cluster_lock_file = config('OBOL_CLUSTER_LOCK_FILE', default='')
3230

3331
obol_node_index: int | None = config(
3432
'OBOL_NODE_INDEX', cast=lambda x: int(x) if x != '' else None, default=''

src/validators/keystores/obol.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ async def load_from_dir(keystores_dir: Path, node_index: int) -> 'ObolKeystore':
6060

6161
@staticmethod
6262
def load_cluster_lock() -> dict:
63+
if not settings.obol_cluster_lock_file:
64+
raise RuntimeError('OBOL_CLUSTER_LOCK_FILE must be set')
65+
6366
return json.load(open(settings.obol_cluster_lock_file, encoding='ascii'))
6467

6568
@staticmethod

0 commit comments

Comments
 (0)