Commit 53177a9b by Brian Coca

Merge pull request #10708 from mscherer/fix_hashing_error

Missing import for ansible.errors (pylint)
parents 76eef1a4 65f6f763
......@@ -20,6 +20,7 @@ from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
from ansible.errors import AnsibleError
# Note, sha1 is the only hash algorithm compatible with python2.4 and with
# FIPS-140 mode (as of 11-2014)
......@@ -65,7 +66,7 @@ def secure_hash(filename, hash_func=sha1):
block = infile.read(blocksize)
infile.close()
except IOError as e:
raise errors.AnsibleError("error while accessing the file %s, error was: %s" % (filename, e))
raise AnsibleError("error while accessing the file %s, error was: %s" % (filename, e))
return digest.hexdigest()
# The checksum algorithm must match with the algorithm in ShellModule.checksum() method
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment