Skip to content

Commit

Permalink
fix: use rmtree on keystore dir_path
Browse files Browse the repository at this point in the history
  • Loading branch information
romanzac committed Aug 7, 2024
1 parent 3bcf999 commit cbeec00
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/node/waku_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
from src.env_vars import DOCKER_LOG_DIR
from src.data_storage import DS
from src.test_data import DEFAULT_CLUSTER_ID
from pathlib import Path

logger = get_custom_logger(__name__)

Expand Down Expand Up @@ -198,9 +197,9 @@ def register_rln(self, **kwargs):

if rln_creds_set:
if rln_credential_store_ready(keystore_path, True):
p = Path(keystore_path)
try:
p.touch()
dir_path = keystore_path.removesuffix("/keystore.json")
shutil.rmtree(dir_path)
except Exception as ex:
logger.error(f"Keystore removal before RLN registration failed {ex}")
raise
Expand Down

0 comments on commit cbeec00

Please sign in to comment.