backported fix of missing import

This commit is contained in:
Brian Coca 2015-06-03 14:36:30 -04:00
parent 54103d23fc
commit 7661f86c05
3 changed files with 5 additions and 3 deletions

@ -1 +1 @@
Subproject commit eda33a45e0e9595eca8da566b04fe8f41fbf1dd2
Subproject commit b138411671194e3ec236d8ec3d27bcf32447350d

@ -1 +1 @@
Subproject commit a3ba1be3f11e8dd16658b592f1dcbe63cc9c9af0
Subproject commit 1276420a3a39340fcd9e053a1e621cdd89f480fa

View file

@ -20,6 +20,8 @@ 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)
@ -63,7 +65,7 @@ def secure_hash(filename, hash_func=sha1):
block = infile.read(blocksize)
infile.close()
except IOError, 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