Skip to content

Commit

Permalink
Fix obol_cluster_lock_file optional (#10)
Browse files Browse the repository at this point in the history
  • Loading branch information
evgeny-stakewise authored Oct 15, 2024
1 parent 3ca9cbc commit 8e9fd40
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
4 changes: 1 addition & 3 deletions src/config/settings.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
from pathlib import Path

from decouple import Choices, Csv, config

from src.config.networks import NETWORKS
Expand Down Expand Up @@ -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=''
Expand Down
3 changes: 3 additions & 0 deletions src/validators/keystores/obol.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 8e9fd40

Please sign in to comment.