From: Mark Hymers Date: Sat, 16 Aug 2008 03:20:19 +0000 (+0000) Subject: actually check the type of basedict before trying to use it X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4c85e19682be05636406315ce1cce69eb96822e8;p=dak actually check the type of basedict before trying to use it Signed-off-by: Mark Hymers --- diff --git a/ChangeLog b/ChangeLog index 3e3f33e1..2991c5b2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,8 @@ 2008-08-15 Mark Hymers + * 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. diff --git a/daklib/utils.py b/daklib/utils.py index 34154ce1..9ad528ab 100755 --- a/daklib/utils.py +++ b/daklib/utils.py @@ -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"])