diff --git a/sarracenia/__init__.py b/sarracenia/__init__.py index b4de69053..14e3337dd 100755 --- a/sarracenia/__init__.py +++ b/sarracenia/__init__.py @@ -35,6 +35,7 @@ import os import os.path import paramiko +import random import re import sarracenia.filemetadata import stat as os_stat @@ -340,7 +341,7 @@ def __computeIdentity(msg, path, o): methods = [ 'random', 'md5', 'md5name', 'sha512', 'cod,md5', 'cod,sha512' ] - calc_method = choice(methods) + calc_method = random.choice(methods) elif 'identity' in xattr.x and 'mtime' in xattr.x: if xattr.get('mtime') >= msg['mtime']: logger.debug("mtime remembered by xattr") @@ -575,7 +576,7 @@ def fromFileInfo(path, o, lstat=None): 'value': o.identity_method[4:] } elif o.identity_method in ['random']: - algo = sarracenia.identity.Indentiy.factory(o.identity_method) + algo = sarracenia.identity.Identity.factory(o.identity_method) algo.set_path(post_relPath) msg['identity'] = { 'method': o.identity_method,