diff --git a/vitrage/common/utils.py b/vitrage/common/utils.py index 565c9a137..648c55095 100644 --- a/vitrage/common/utils.py +++ b/vitrage/common/utils.py @@ -93,9 +93,13 @@ def spawn(target, *args, **kwargs): def md5(obj): if isinstance(obj, tuple): - obj = str(obj) + obj = str([str(o) for o in obj]) + if isinstance(obj, six.string_types): - return hashlib.md5(six.b(obj)).hexdigest() + if six.PY2: + return hashlib.md5(obj).hexdigest() + else: + return hashlib.md5(obj.encode('utf-8')).hexdigest() raise Exception('Unknown object for md5 %s', str(obj))