mirror of
https://github.com/Stone-Red-Code/dvc.git
synced 2026-11-07 23:09:21 +01:00
cloud: gcp: decode base64 when comparing files
Otherwise comparison with string fails on Python3, as base64 returns bytes. Signed-off-by: Ruslan Kuprieiev <[email protected]>
This commit is contained in:
+2
-2
@@ -694,7 +694,8 @@ class DataCloudGCP(DataCloudBase):
|
||||
"""
|
||||
Verify local and remote checksums.
|
||||
"""
|
||||
b64_encoded_md5 = base64.b64encode(file_md5(fname)[1])
|
||||
md5 = file_md5(fname)[1]
|
||||
b64_encoded_md5 = base64.b64encode(md5).decode() if md5 else None
|
||||
|
||||
if blob.md5_hash == b64_encoded_md5:
|
||||
return True
|
||||
@@ -726,7 +727,6 @@ class DataCloudGCP(DataCloudBase):
|
||||
|
||||
try:
|
||||
blob.download_to_filename(tmp_file)
|
||||
data_item.import_cache(tmp_file)
|
||||
except Exception as exc:
|
||||
Logger.error('Failed to download "{}": {}'.format(key, exc))
|
||||
return None
|
||||
|
||||
Reference in New Issue
Block a user