Skip to content

Commit

Permalink
Manifest reproduce logs note missing or new files
Browse files Browse the repository at this point in the history
  • Loading branch information
jo-basevi committed Aug 22, 2024
1 parent 7ff9f46 commit 8fae6f9
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions payu/manifest.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,25 @@ def check_reproduce(self, previous_manifest):
hash = self.get(filepath, hashfn)
previous_hash = previous_manifest.get(filepath, hashfn)

if hash != previous_hash:
if hash is None:
differences.append(
f" {filepath}: Missing file (file not in " +
"calculated manifest)"
)
elif previous_hash is None:
differences.append(
f" {filepath}: New file (file not in stored manifest)"
)
elif hash != previous_hash:
differences.append(
f"{filepath}: {hashfn}: {previous_hash} != {hash}"
f" {filepath}: {hashfn}: {previous_hash} != {hash}"
)

if len(differences) != 0:
sys.stderr.write(
f'Run cannot reproduce: manifest {self.path} is not correct\n'
)
print("Manifest path: hash != calculated hash")
print(f"Manifest path: stored hash != calculated hash")
for row in differences:
print(row)

Expand Down

0 comments on commit 8fae6f9

Please sign in to comment.