]> git.decadent.org.uk Git - dak.git/commitdiff
actually check the type of basedict before trying to use it
authorMark Hymers <mhy@debian.org>
Sat, 16 Aug 2008 03:20:19 +0000 (03:20 +0000)
committerMark Hymers <mhy@debian.org>
Sat, 16 Aug 2008 03:20:19 +0000 (03:20 +0000)
Signed-off-by: Mark Hymers <mhy@debian.org>
ChangeLog
daklib/utils.py

index 3e3f33e17d99a365095a4aae29e6fafaf5e27c77..2991c5b25ff7c2a71469f36745704947e10edc40 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2008-08-15  Mark Hymers  <mhy@debian.org>
 
+       * daklib/utils.py: Actually check we have basedict before trying to
+       use it.
+
        *  dak/process_accepted.py, dak/process_unchecked.py,
        daklib/database.py: Don't change get_files_id to use sha1sum and
        sha256sum.
index 34154ce139af43856c0bc850a69fd5bd583226e5..9ad528ab624c560b6d91b7519ec679235144e29f 100755 (executable)
@@ -220,7 +220,8 @@ def create_hash (lfiles, key, testfn, basedict = None):
             rejmsg.append("Could not open file %s for checksumming" % (f))
 
         # Check hash
-        basedict[f]['%ssum' % key] = testfn(file_handle)
+        if basedict:
+            basedict[f]['%ssum' % key] = testfn(file_handle)
         file_handle.close()
 
     return rejmsg
@@ -248,7 +249,8 @@ def check_hash (where, lfiles, key, testfn, basedict = None):
             rejmsg.append("%s: %s check failed." % (f, key))
         file_handle.close()
         # Store the hashes for later use
-        basedict[f]['%ssum' % key] = lfiles[f][key]
+        if basedict:
+            basedict[f]['%ssum' % key] = lfiles[f][key]
         # Check size
         actual_size = os.stat(f)[stat.ST_SIZE]
         size = int(lfiles[f]["size"])