Skip to content

Commit

Permalink
fixes #363
Browse files Browse the repository at this point in the history
  • Loading branch information
o-smirnov committed Mar 2, 2025
1 parent b801566 commit 8901256
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions stimela/backends/singularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,16 @@ def build(cab: 'stimela.kitchen.cab.Cab', backend: 'stimela.backend.StimelaBacke
str: path to corresponding singularity image
"""

# ensure image directory exists
if os.path.exists(backend.singularity.image_dir):
if not os.path.isdir(backend.singularity.image_dir):
raise BackendError(f"invalid singularity image directory {backend.singularity.image_dir}")
else:
try:
os.mkdir(backend.singularity.image_dir)
except OSError as exc:
raise BackendError(f"failed to create singularity image directory {backend.singularity.image_dir}: {exc}")

image_name, simg_path = get_image_info(cab, backend)

# this is True if we're allowed to build missing images
Expand Down

0 comments on commit 8901256

Please sign in to comment.