Skip to content

Commit

Permalink
Make sure we dump providers to JSON before writing
Browse files Browse the repository at this point in the history
  • Loading branch information
t-persson committed Mar 8, 2024
1 parent 6cd0928 commit 4b88e90
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions python/src/etos_api/library/providers/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,20 +46,20 @@ def load_providers_from_disk(self) -> None:
self.logger.info("Registering execution space provider: %s", provider)
self.validate(provider, execution_space_provider_schema(provider))
self.root.join(f"execution-space/{provider['execution_space']['id']}").write(
provider
json.dumps(provider)
)

if os.getenv("LOG_AREA_PROVIDERS"):
for provider in self.providers(Path(os.getenv("LOG_AREA_PROVIDERS"))):
self.logger.info("Registering log area provider: %s", provider)
self.validate(provider, log_area_provider_schema(provider))
self.root.join(f"log-area/{provider['log']['id']}").write(provider)
self.root.join(f"log-area/{provider['log']['id']}").write(json.dumps(provider))

if os.getenv("IUT_PROVIDERS"):
for provider in self.providers(Path(os.getenv("IUT_PROVIDERS"))):
self.logger.info("Registering IUT provider: %s", provider)
self.validate(provider, iut_provider_schema(provider))
self.root.join(f"iut/{provider['iut']['id']}").write(provider)
self.root.join(f"iut/{provider['iut']['id']}").write(json.dumps(provider))

def providers(self, directory: Path) -> Iterator[dict]:
"""Read provider json files from a directory.
Expand Down

0 comments on commit 4b88e90

Please sign in to comment.