harvestman (1.4.6-13) 06_hashlib_not_md5.dpatch

Summary

 HarvestMan/connector.py |    6 +++---
 HarvestMan/datamgr.py   |    4 ++--
 2 files changed, 5 insertions(+), 5 deletions(-)

    
download this patch

Patch contents

#! /bin/sh /usr/share/dpatch/dpatch-run
## 06_hashlib_not_md5.dpatch by  <akumar@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: Patch from Scott Kitterman to use hashlib for Python 2.6, instead of md5.

@DPATCH@
diff -urNad harvestman-1.4.6~/HarvestMan/connector.py harvestman-1.4.6/HarvestMan/connector.py
--- harvestman-1.4.6~/HarvestMan/connector.py	2005-08-19 03:19:04.000000000 -0500
+++ harvestman-1.4.6/HarvestMan/connector.py	2009-04-29 17:52:50.000000000 -0500
@@ -60,7 +60,7 @@
 """
 
 import sys
-import md5
+import hashlib
 import socket
 import time
 import threading as tg
@@ -965,12 +965,12 @@
     def verify_checksum(self, filename):
         """ Verify data written to file using md5 checksum """
 
-        m1=md5.new()
+        m1=hashlib.md5()
         m1.update(self.__data)
         mdigest1=m1.digest()
         mdigest2=''
 
-        m2=md5.new()
+        m2=hashlib.md5()
         try:
             m2.update(open(filename, 'rb').read())
         except:
diff -urNad harvestman-1.4.6~/HarvestMan/datamgr.py harvestman-1.4.6/HarvestMan/datamgr.py
--- harvestman-1.4.6~/HarvestMan/datamgr.py	2005-08-19 03:17:53.000000000 -0500
+++ harvestman-1.4.6/HarvestMan/datamgr.py	2009-04-29 17:53:28.000000000 -0500
@@ -150,9 +150,9 @@
             return (False, False)
 
         # Look up the dictionary containing the url cache info
-        import md5
+        import hashlib
 
-        m1=md5.new()
+        m1=hashlib.md5()
         digest1=m1.digest()
 
         # Assume that cache is not uptodate apriori