summaryrefslogtreecommitdiffstats
path: root/nova/volume
diff options
context:
space:
mode:
authorBen Swartzlander <bswartz@netapp.com>2012-09-19 17:30:22 -0400
committerBen Swartzlander <bswartz@netapp.com>2012-09-19 22:35:17 -0400
commitba8cca2b59bb2904635520ad12f6d9a73f10242c (patch)
treee688b438325d6d7a6d072bdb3d819befe6e83ea7 /nova/volume
parent2934799fda4ca62337833a3ed736da5dce1210ae (diff)
downloadnova-ba8cca2b59bb2904635520ad12f6d9a73f10242c.tar.gz
nova-ba8cca2b59bb2904635520ad12f6d9a73f10242c.tar.xz
nova-ba8cca2b59bb2904635520ad12f6d9a73f10242c.zip
Replace builtin hash with MD5 to solve 32/64-bit issues.
It seems that Python's builtin hash returns different values on 32-bit and 64-bit architectures, so it's safer to use a well-defined hash like MD5. bug 1050359 Change-Id: Ibb49f7b9028085d2aedaf05b94e1e1dcdf5e4cb4
Diffstat (limited to 'nova/volume')
-rw-r--r--nova/volume/nfs.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/nova/volume/nfs.py b/nova/volume/nfs.py
index f91b52018..7a6ca8307 100644
--- a/nova/volume/nfs.py
+++ b/nova/volume/nfs.py
@@ -15,8 +15,8 @@
# License for the specific language governing permissions and limitations
# under the License.
-import ctypes
import errno
+import hashlib
import os
from nova import exception
@@ -290,4 +290,4 @@ class NfsDriver(driver.VolumeDriver):
def _get_hash_str(self, base_str):
"""returns string that represents hash of base_str (in a hex format)"""
- return str(ctypes.c_uint64(hash(base_str)).value)
+ return hashlib.md5(base_str).hexdigest()