Skip to content

Commit

Permalink
Validate reference files when validating system state
Browse files Browse the repository at this point in the history
  • Loading branch information
sonicaj committed Dec 29, 2023
1 parent cc74620 commit a1b641c
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion scale_build/validate.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import logging
import shutil

from truenas_install import fhs

from .exceptions import CallError, MissingPackagesException
from .utils.manifest import validate_manifest
from truenas_install import fhs
from .utils.paths import REFERENCE_FILES, REFERENCE_FILES_DIR


logger = logging.getLogger(__name__)
Expand All @@ -32,6 +34,11 @@ def validate_system_state():
if missing_packages:
raise MissingPackagesException(missing_packages)

if missing_files := [
f for f in map(lambda f: os.path.join(REFERENCE_FILES_DIR, f), REFERENCE_FILES) if not os.path.exists(f)
]:
raise CallError(f'Missing reference files: {", ".join(missing_files)!r}')


def validate_datasets():
try:
Expand Down

0 comments on commit a1b641c

Please sign in to comment.