Skip to content

Commit

Permalink
Print submission script
Browse files Browse the repository at this point in the history
  • Loading branch information
danielhollas committed Nov 29, 2024
1 parent d7eef6e commit bcd0495
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
7 changes: 7 additions & 0 deletions aiida_test_cache/mock_code/_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ def _log(msg: str, error=False) -> None:
_log(f"No cache hit for: {res_dir}")

if not res_dir.exists():
p = subprocess.run(['cat', '_aiidasubmit.sh'],
capture_output=True,
encoding='utf-8',
check=False)
_log("################")
_log("Actual submit.sh")
_log(f"\n{p.stdout}")
if not env.executable_path:
_log("No existing cache, and no executable specified.", error=True)

Expand Down
3 changes: 3 additions & 0 deletions aiida_test_cache/mock_code/_hasher.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ def __call__(self, cwd: Path) -> str:
file_content_bytes = file_obj.read()
if path.name == self.SUBMIT_FILE:
file_content_bytes = self._strip_submit_content(file_content_bytes)
self.log("##################")
self.log("Stripped submit.sh")
self.log(f"\n{file_content_bytes.decode('utf-8')}")
file_content_bytes = self.modify_content(path, file_content_bytes)
if file_content_bytes is not None:
md5sum.update(path.name.encode())
Expand Down

0 comments on commit bcd0495

Please sign in to comment.