catalyst: probably works

This commit is contained in:
Rick Farina (Zero_Chaos) 2020-01-28 13:19:00 -05:00
parent 5703b2ce3c
commit f34849953c
No known key found for this signature in database
GPG key ID: A29433C0AA431DDC

View file

@ -1,15 +1,29 @@
diff --git a/catalyst/hash_utils.py b/catalyst/hash_utils.py
index 1134f50..82e2a34 100644
index 1134f50..0455ea1 100644
--- a/catalyst/hash_utils.py
+++ b/catalyst/hash_utils.py
@@ -11,6 +11,7 @@ from catalyst.support import CatalystError
# fields = ["func", "cmd", "args", "id"]
HASH_DEFINITIONS = {
"adler32" :["calc_hash2", "shash", ["-a", "ADLER32"], "ADLER32"],
+ "blake2" :["calc_hash2", "b2sum", [ "", "" ], "BLAKE2"],
+ "blake2" :["calc_hash", "b2sum", [ ], "BLAKE2"],
"crc32" :["calc_hash2", "shash", ["-a", "CRC32"], "CRC32"],
"crc32b" :["calc_hash2", "shash", ["-a", "CRC32B"], "CRC32B"],
"gost" :["calc_hash2", "shash", ["-a", "GOST"], "GOST"],
@@ -94,9 +95,11 @@ class HashMap(object):
args = [_hash.cmd]
args.extend(_hash.args)
args.append(file_)
+ log.debug('args = %r', args)
source = Popen(args, stdout=PIPE)
- mylines = source.communicate()[0]
- mylines=mylines[0].split()
+ output = source.communicate()
+ mylines = output[0].decode('ascii').split('\n')
+ log.debug('output = %s', mylines)
result=mylines[0]
log.info('%s (%s) = %s', _hash.id, file_, result)
return result
diff --git a/etc/catalyst.conf b/etc/catalyst.conf
index 5a5eedb..ee014c1 100644
--- a/etc/catalyst.conf