# Buggy code
def hash_file(self, path, saltenv="base", env=None):
    """
    Return the hash of a file, to get the hash of a file on the salt
    master file server prepend the path with salt://<file on server>
    otherwise, prepend the file with / for a local file.
    """
    if env is not None:
        salt.utils.warn_until(
            "Boron",
            "Passing a salt environment should be done using 'saltenv' "
            "not 'env'. This functionality will be removed in Salt "
            "Boron.",
        )
        # Backwards compatibility
        saltenv = env

    try:
        path = self._check_proto(path)
    except MinionError:
        if not os.path.isfile(path):
            err = "Specified file {0} is not present to generate hash"
            log.warning(err.format(path))
            return {}
        else:
            ret = {}
            ret["hsum"] = salt.utils.get_hash(path, form="md5", chunk_size=4096)
            ret["hash_type"] = "md5"
            return ret
    load = {"path": path, "saltenv": saltenv, "cmd": "_file_hash"}
    try:
        channel = salt.transport.Channel.factory(self.opts, auth=self.auth)
        return channel.send(load)
    except SaltReqTimeoutError:
        return ""


# Traceback (ValueError)
[root@minion-fips ~]# salt-call state.sls httpd
[INFO    ] Loading fresh modules for state activity
[ERROR   ] An un-handled exception was caught by salt's global exception handler:
ValueError: error:060800A3:digital envelope routines:EVP_DigestInit_ex:disabled for fips
Traceback (most recent call last):
File "/usr/bin/salt-call", line 11, in <module>
salt_call()
File "/usr/lib/python2.6/site-packages/salt/scripts.py", line 82, in salt_call
client.run()
File "/usr/lib/python2.6/site-packages/salt/cli/__init__.py", line 314, in run
caller.run()
File "/usr/lib/python2.6/site-packages/salt/cli/caller.py", line 142, in run
ret = self.call()
File "/usr/lib/python2.6/site-packages/salt/cli/caller.py", line 80, in call
ret['return'] = func(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/salt/modules/state.py", line 372, in sls
high_, errors = st_.render_highstate({saltenv: mods})
File "/usr/lib/python2.6/site-packages/salt/state.py", line 2375, in render_highstate
state, errors = self.render_state(sls, saltenv, mods, matches)
File "/usr/lib/python2.6/site-packages/salt/state.py", line 2084, in render_state
state_data = self.client.get_state(sls, saltenv)
File "/usr/lib/python2.6/site-packages/salt/fileclient.py", line 413, in get_state
dest = self.cache_file(path, saltenv)
File "/usr/lib/python2.6/site-packages/salt/fileclient.py", line 143, in cache_file
return self.get_url(path, '', True, saltenv)
File "/usr/lib/python2.6/site-packages/salt/fileclient.py", line 503, in get_url
return self.get_file(url, dest, makedirs, saltenv)
File "/usr/lib/python2.6/site-packages/salt/fileclient.py", line 894, in get_file
hash_local = self.hash_file(dest2check, saltenv)
File "/usr/lib/python2.6/site-packages/salt/fileclient.py", line 1100, in hash_file
path, form='md5', chunk_size=4096)
File "/usr/lib/python2.6/site-packages/salt/utils/__init__.py", line 1437, in get_hash
hash_obj = hash_type()
ValueError: error:060800A3:digital envelope routines:EVP_DigestInit_ex:disabled for fips

# Fixed code
def hash_file(self, path, saltenv="base", env=None):
    """
    Return the hash of a file, to get the hash of a file on the salt
    master file server prepend the path with salt://<file on server>
    otherwise, prepend the file with / for a local file.
    """
    if env is not None:
        salt.utils.warn_until(
            "Boron",
            "Passing a salt environment should be done using 'saltenv' "
            "not 'env'. This functionality will be removed in Salt "
            "Boron.",
        )
        # Backwards compatibility
        saltenv = env

    try:
        path = self._check_proto(path)
    except MinionError:
        if not os.path.isfile(path):
            err = "Specified file {0} is not present to generate hash"
            log.warning(err.format(path))
            return {}
        else:
            ret = {}
            hash_type = self.opts.get("hash_type", "md5")
            ret["hsum"] = salt.utils.get_hash(path, form=hash_type, chunk_size=4096)
            ret["hash_type"] = "md5"
            return ret
    load = {"path": path, "saltenv": saltenv, "cmd": "_file_hash"}
    try:
        channel = salt.transport.Channel.factory(self.opts, auth=self.auth)
        return channel.send(load)
    except SaltReqTimeoutError:
        return ""