[mirrorbrain-commits] r8033 - /trunk/mirrordoctor/mb/hashes.py

From: <poeml_at_mirrorbrain.org>
Date: Mon, 29 Mar 2010 04:48:58 -0000
Author: poeml
Date: Mon Mar 29 06:48:56 2010
New Revision: 8033

URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain?rev=8033&view=rev
Log:
mb makehashes:
- When hashing fails (file unreadable, for instance), we have no hash data, but
  still need to make sure that the database doesn't get NULL for some columns

Modified:
    trunk/mirrordoctor/mb/hashes.py

Modified: trunk/mirrordoctor/mb/hashes.py
URL: http://svn.mirrorbrain.org/viewvc/mirrorbrain/trunk/mirrordoctor/mb/hashes.py?rev=8033&r1=8032&r2=8033&view=diff
==============================================================================
--- trunk/mirrordoctor/mb/hashes.py (original)
+++ trunk/mirrordoctor/mb/hashes.py Mon Mar 29 06:48:56 2010
_at_@ -147,8 +147,8 @@
                                  decode(%s, 'hex'), %s, decode(%s, 'hex'),
                                  %s, %s, %s, decode(%s, 'hex'))""",
                       [file_id, int(self.mtime), self.size,
-                       self.hb.md5hex,
-                       self.hb.sha1hex,
+                       self.hb.md5hex or '',
+                       self.hb.sha1hex or '',
                        self.hb.sha256hex or '',
                        PIECESIZE,
                        ''.join(self.hb.pieceshex),
_at_@ -182,7 +182,7 @@
                                          zsums = decode(%s, 'hex')
                          WHERE file_id = %s""",
                       [int(self.mtime), self.size,
-                       self.hb.md5hex, self.hb.sha1hex, self.hb.sha256hex or '',
+                       self.hb.md5hex or '', self.hb.sha1hex or '', self.hb.sha256hex or '',
                        PIECESIZE, ''.join(self.hb.pieceshex),
                        self.hb.pgp or '', 
                        self.hb.zblocksize,




_______________________________________________
mirrorbrain-commits mailing list
Archive: http://mirrorbrain.org/archive/mirrorbrain-commits/

Note: To remove yourself from this list, send a mail with the content
 	unsubscribe
to the address mirrorbrain-commits-request_at_mirrorbrain.org
Received on Mon Mar 29 2010 - 04:49:01 GMT

This archive was generated by hypermail 2.3.0 : Mon Feb 20 2012 - 23:47:04 GMT