Skip to content

Commit

Permalink
Fix a couple of problems in init (#727)
Browse files Browse the repository at this point in the history
These were found when developing unit tests
  • Loading branch information
gcglinton committed Jul 25, 2023
1 parent 0762763 commit b375512
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sarracenia/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import os
import os.path
import paramiko
import random
import re
import sarracenia.filemetadata
import stat as os_stat
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit b375512

Please sign in to comment.