vars: make populate_dir a method of StoreBase

This commit is contained in:
Michael Hoang
2024-12-22 12:58:27 +11:00
committed by Mic92
parent 1d7e0c1c02
commit 0bf701de63
3 changed files with 12 additions and 0 deletions

View File

@@ -152,3 +152,7 @@ class StoreBase(ABC):
if target_hash is None and stored_hash is None:
return True
return stored_hash == target_hash
@abstractmethod
def populate_dir(self, output_dir: Path) -> None:
pass

View File

@@ -49,3 +49,7 @@ class FactStore(StoreBase):
def exists(self, generator: Generator, name: str) -> bool:
return (self.directory(generator, name) / "value").exists()
def populate_dir(self, output_dir: Path) -> None:
msg = "populate_dir is not implemented for public vars stores"
raise NotImplementedError(msg)

View File

@@ -47,3 +47,7 @@ class FactStore(StoreBase):
return fact_path.read_bytes()
msg = f"Fact {name} for service {generator.name} not found"
raise ClanError(msg)
def populate_dir(self, output_dir: Path) -> None:
msg = "populate_dir is not implemented for public vars stores"
raise NotImplementedError(msg)