Repository: trafficserver-qa
Updated Branches:
  refs/heads/master 02f9b070f -> c04800889


Use MD5 hash to ID an environment


Project: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/commit/127fb83b
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/tree/127fb83b
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver-qa/diff/127fb83b

Branch: refs/heads/master
Commit: 127fb83b0f96f451049547da1a99d3c2c2180397
Parents: 02f9b07
Author: James Peach <[email protected]>
Authored: Tue Mar 3 20:52:23 2015 -0800
Committer: James Peach <[email protected]>
Committed: Tue Mar 3 20:54:49 2015 -0800

----------------------------------------------------------------------
 tsqa/environment.py | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver-qa/blob/127fb83b/tsqa/environment.py
----------------------------------------------------------------------
diff --git a/tsqa/environment.py b/tsqa/environment.py
index 4c0c96e..4a01e01 100644
--- a/tsqa/environment.py
+++ b/tsqa/environment.py
@@ -23,6 +23,7 @@ import tsqa.utils
 import sys
 import time
 import multiprocessing
+import hashlib
 
 import tsqa.configs
 import tsqa.utils
@@ -116,13 +117,12 @@ class EnvironmentFactory(object):
         Take list of dicts and make a nice tuple list to use as a key
         take that and then hash it
         '''
-        key = []
+        hval = hashlib.md5()
         for arg in args:
-            sub_key = []
             for k in sorted(arg):
-                sub_key.append((k, arg[k]))
-            key.append(tuple(sub_key))
-        return str(hash(tuple(key)))  # return a string since JSON doesn't 
like ints as keys
+                hval.update(k)
+                hval.update(str(arg[k]))
+        return hval.hexdigest()
 
     def get_environment(self, configure=None, env=None):
         '''

Reply via email to