graphite-dev team mailing list archive
-
graphite-dev team
-
Mailing list archive
-
Message #00786
[Merge] lp:~katzj/graphite/centos into lp:graphite
Jeremy Katz has proposed merging lp:~katzj/graphite/centos into lp:graphite.
Requested reviews:
graphite-dev (graphite-dev)
For more details, see:
https://code.launchpad.net/~katzj/graphite/centos/+merge/56445
Keep working with python2.4
--
https://code.launchpad.net/~katzj/graphite/centos/+merge/56445
Your team graphite-dev is requested to review the proposed merge of lp:~katzj/graphite/centos into lp:graphite.
=== modified file 'carbon/lib/carbon/hashing.py'
--- carbon/lib/carbon/hashing.py 2011-04-05 02:28:45 +0000
+++ carbon/lib/carbon/hashing.py 2011-04-05 19:50:49 +0000
@@ -1,4 +1,7 @@
-import hashlib
+try:
+ from hashlib import md5
+except ImportError:
+ from md5 import md5
import bisect
@@ -13,7 +16,7 @@
self.add_node(node)
def compute_ring_position(self, key):
- big_hash = hashlib.md5( str(key) ).hexdigest()
+ big_hash = md5( str(key) ).hexdigest()
small_hash = int(big_hash[:4], 16)
return small_hash
=== modified file 'webapp/graphite/render/hashing.py'
--- webapp/graphite/render/hashing.py 2011-04-05 02:28:45 +0000
+++ webapp/graphite/render/hashing.py 2011-04-05 19:50:49 +0000
@@ -14,7 +14,10 @@
limitations under the License."""
import time
-import hashlib
+try:
+ from hashlib import md5
+except ImportError:
+ from md5 import md5
import bisect
def hashRequest(request):
@@ -49,7 +52,7 @@
def compactHash(string):
- hash = hashlib.md5()
+ hash = md5()
hash.update(string)
return hash.hexdigest()
@@ -63,7 +66,7 @@
self.add_node(node)
def compute_ring_position(self, key):
- big_hash = hashlib.md5( str(key) ).hexdigest()
+ big_hash = md5( str(key) ).hexdigest()
small_hash = int(big_hash[:4], 16)
return small_hash