Skip to content

Commit

Permalink
Allow for emtpy env
Browse files Browse the repository at this point in the history
  • Loading branch information
rfbgo committed Dec 13, 2023
1 parent 221cf72 commit 07559a9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/ramble/ramble/spack_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,16 +602,20 @@ def inventory_hash(self, require_exist=False):
contents_to_hash = None

if not self.dry_run:
if not lock_exists and (require_exist or len(self.env_contents) == 0):
if not lock_exists and require_exist and len(self.env_contents) > 0:
logger.die(
'spack.lock file does not exist in environment '
f'{self.env_path}\n'
'Make sure your workspace is fully setup with\n'
' ramble workspace setup'
)
elif len(self.env_contents) == 0:
contents_to_hash = {}
elif lock_exists:
with open(spack_file, 'r') as f:
contents_to_hash = sjson.load(f)
else:
logger.die('Issue with spack.lock file')

if self.dry_run or not lock_exists:
contents_to_hash = self._env_file_dict()
Expand Down

0 comments on commit 07559a9

Please sign in to comment.