Autotest: Porting all hash operations to use utils.hash
Replace all functions that evaluate md5 and sha1 hexdigests
with the function utils.hash().
Signed-off-by: Lucas Meneghel Rodrigues <lmr@redhat.com>
git-svn-id: http://test.kernel.org/svn/autotest/trunk@4204 592f7852-d20e-0410-864c-8624ca9c26a4
diff --git a/frontend/planner/models.py b/frontend/planner/models.py
index c4d8988..7f62471 100644
--- a/frontend/planner/models.py
+++ b/frontend/planner/models.py
@@ -3,7 +3,7 @@
from autotest_lib.frontend.afe import models as afe_models
from autotest_lib.frontend.afe import model_logic, rpc_utils
from autotest_lib.frontend.tko import models as tko_models
-from autotest_lib.client.common_lib import enum
+from autotest_lib.client.common_lib import enum, utils
class Plan(dbmodels.Model):
@@ -102,7 +102,7 @@
@classmethod
def _compute_hash(cls, **kwargs):
- return rpc_utils.get_sha1_hash(kwargs['contents'])
+ return utils.hash('sha1', kwargs['contents']).hexdigest()
def __unicode__(self):
@@ -322,8 +322,8 @@
@classmethod
def _compute_hash(cls, **kwargs):
- round1 = rpc_utils.get_sha1_hash(kwargs['key'])
- return rpc_utils.get_sha1_hash(round1 + kwargs['value'])
+ round1 = utils.hash('sha1', kwargs['key']).hexdigest()
+ return utils.hash('sha1', round1 + kwargs['value']).hexdigest()
def __unicode__(self):