Commit fd5114d1 authored by Łukasz Nowak's avatar Łukasz Nowak

Expose SHA512SUM on successful upload

This gives user the possibility to check what was uploaded to shacache.
parent dcafc514
...@@ -236,12 +236,17 @@ class Signature: ...@@ -236,12 +236,17 @@ class Signature:
'token': ''.join([choice(ascii_lowercase) for _ in range(128)]) 'token': ''.join([choice(ascii_lowercase) for _ in range(128)])
} }
try: try:
if shacache.upload(path=path, sha512sum = shacache.upload(path=path, metadata_dict=metadata_dict)
metadata_dict=metadata_dict): if sha512sum:
self.log('Uploaded %s to cache (using %s key).', path, shacache.directory_key) self.log(
if shacache.upload(path=sha256path, 'Uploaded %s to cache (using %s key) with SHA512 %s.', path,
metadata_dict=metadata_dict, is_sha256file=True): shacache.directory_key, sha512sum)
self.log('Uploaded %s to cache (using %s key).', sha256path, shacache.directory_key) sha512sum_path = shacache.upload(
path=sha256path, metadata_dict=metadata_dict, is_sha256file=True)
if sha512sum_path:
self.log(
'Uploaded %s to cache (using %s key) with SHA512 %s.', sha256path,
shacache.directory_key, sha512sum_path)
else: else:
self.log('Fail to upload sha256file file to cache.') self.log('Fail to upload sha256file file to cache.')
else: else:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment