From 329d876b2c5a45598abdd5c5db13d79c6303a334 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tarjei=20Hus=C3=B8y?= Date: Sun, 10 Aug 2014 17:15:58 +0200 Subject: [PATCH] Use salt.utils.get_hash also in local client Closes #14784. --- salt/fileclient.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/salt/fileclient.py b/salt/fileclient.py index d5e9652ed4..928330c53a 100644 --- a/salt/fileclient.py +++ b/salt/fileclient.py @@ -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']