vars: make populate_dir a method of StoreBase
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user