Skip to content

Commit d33de01

Browse files
committed
Catching builder exceptions.
1 parent 21c507c commit d33de01

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

stackinator/builder.py

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -314,11 +314,12 @@ def generate(self, recipe):
314314
fid.write(global_packages_yaml)
315315

316316
# generate a mirrors.yaml file if build caches have been configured
317-
if recipe.mirrors:
318-
self._logger.debug(f"Generating the spack mirror configs in '{config_path}'")
319-
recipe.mirrors.key_setup(config_path/'key_store')
320-
recipe.mirrors.create_spack_mirrors_yaml(config_path/'mirrors.yaml')
321-
recipe.mirrors.create_bootstrap_configs(config_path)
317+
self._logger.debug(f"Generating the spack mirror configs in '{config_path}'")
318+
try:
319+
recipe.mirrors.setup_configs(config_path)
320+
except mirror.MirrorError as err:
321+
self._logger.error(f"Could not set up mirrors.\n{err}")
322+
return 1
322323

323324
# Add custom spack package recipes, configured via Spack repos.
324325
# Step 1: copy Spack repos to store_path where they will be used to

0 commit comments

Comments
 (0)