Skip to content

Commit

Permalink
[fix] Registry logic fix
Browse files Browse the repository at this point in the history
  • Loading branch information
tamohannes committed Jun 27, 2024
1 parent 75fce73 commit 6409751
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 12 deletions.
2 changes: 1 addition & 1 deletion urartu/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.11
2.0.12
20 changes: 9 additions & 11 deletions urartu/utils/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,18 +32,16 @@ def add_entry(module_name, module_root_dir):
def load_file_content():
if not Registry.REGISTRY_FILE_PATH.exists():
Registry.REGISTRY_FILE_PATH.touch()
return {}

with open(Registry.REGISTRY_FILE_PATH, "r") as file:
file_content = yaml.safe_load(file)

file_content = None
else:
with open(Registry.REGISTRY_FILE_PATH, "r") as file:
file_content = yaml.safe_load(file)
if file_content is None:
raise RuntimeError(
f"Registery is empty, register a module using `urartu register --name='NAME' --path='PATH'` command."
)

with open(Registry.REGISTRY_FILE_PATH, "r") as file:
file_content = yaml.safe_load(file)
return {}
# raise RuntimeError(
# f"Registery is empty, register a module using `urartu register --name='NAME' --path='PATH'` command."
# )

return file_content

Expand Down

0 comments on commit 6409751

Please sign in to comment.