mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #14882 from thusoy/chunked-hashing
Use salt.utils.get_hash also in local client
This commit is contained in:
commit
0abe9a6c02
@ -832,8 +832,8 @@ class LocalClient(Client):
|
||||
else:
|
||||
opts_hash_type = self.opts.get('hash_type', 'md5')
|
||||
hash_type = getattr(hashlib, opts_hash_type)
|
||||
with salt.utils.fopen(path, 'rb') as ifile:
|
||||
ret['hsum'] = hash_type(ifile.read()).hexdigest()
|
||||
ret['hsum'] = salt.utils.get_hash(
|
||||
path, form=hash_type)
|
||||
ret['hash_type'] = opts_hash_type
|
||||
return ret
|
||||
path = self._find_file(path, saltenv)['path']
|
||||
|
Loading…
Reference in New Issue
Block a user