diff options
author | Rafi Khardalian <rafi@metacloud.com> | 2013-02-03 02:41:35 +0000 |
---|---|---|
committer | Rafi Khardalian <rafi@metacloud.com> | 2013-02-03 05:45:57 +0000 |
commit | 2667e8fe2128c42c69bfb6163e96ad24f8151684 (patch) | |
tree | 14c681722264aad5f5dc696e5998898768b713cf | |
parent | 3793b061df30e1f56094d7e579bca59b9c20de98 (diff) | |
download | nova-2667e8fe2128c42c69bfb6163e96ad24f8151684.tar.gz nova-2667e8fe2128c42c69bfb6163e96ad24f8151684.tar.xz nova-2667e8fe2128c42c69bfb6163e96ad24f8151684.zip |
Make NFS mount hashes consistent with Cinder
Cinder is using a different hash method for mount point uniqueness.
This change makes Nova's hash method identical.
Change-Id: I64e0200ae341fa90cf66b86fa3cb11ad02e773c6
-rwxr-xr-x[-rw-r--r--] | nova/virt/libvirt/volume_nfs.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nova/virt/libvirt/volume_nfs.py b/nova/virt/libvirt/volume_nfs.py index 70bb8c38f..7f721a534 100644..100755 --- a/nova/virt/libvirt/volume_nfs.py +++ b/nova/virt/libvirt/volume_nfs.py @@ -17,7 +17,7 @@ """Volume driver for using NFS as volumes storage. Nova compute part.""" -import ctypes +import hashlib import os from nova import exception @@ -82,7 +82,7 @@ class NfsVolumeDriver(volume.LibvirtBaseVolumeDriver): @staticmethod def get_hash_str(base_str): """returns string that represents hash of base_str (in hex format).""" - return str(ctypes.c_uint64(hash(base_str)).value) + return hashlib.md5(base_str).hexdigest() @staticmethod def _path_exists(path): |