summaryrefslogtreecommitdiff
path: root/lib/thandy/download.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/thandy/download.py')
-rw-r--r--lib/thandy/download.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/thandy/download.py b/lib/thandy/download.py
index c2a9e61..308f356 100644
--- a/lib/thandy/download.py
+++ b/lib/thandy/download.py
@@ -438,6 +438,16 @@ class DownloadJob:
the hash and/or format we need."""
if self._wantHash and not self._repoFile:
gotHash = thandy.formats.getFileDigest(self._tmpPath)
+ with open(self._tmpPath, "r") as f:
+ data = f.read()
+ import json
+ obj = json.loads(data)
+ main_obj = obj['signed']
+ gotHash = thandy.formats.getDigest(main_obj)
+ #print self._tmpPath, "ObjHash:", thandy.formats.formatHash(jsonHash)
+
+ print self._tmpPath, "Got:", thandy.formats.formatHash(gotHash)
+ print self._tmpPath, "Expected:", thandy.formats.formatHash(self._wantHash)
if gotHash != self._wantHash:
raise thandy.FormatException("File hash was not as expected.")
elif self._repoFile: