From 2667e8fe2128c42c69bfb6163e96ad24f8151684 Mon Sep 17 00:00:00 2001 From: Rafi Khardalian Date: Sun, 3 Feb 2013 02:41:35 +0000 Subject: 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 --- nova/virt/libvirt/volume_nfs.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) mode change 100644 => 100755 nova/virt/libvirt/volume_nfs.py diff --git a/nova/virt/libvirt/volume_nfs.py b/nova/virt/libvirt/volume_nfs.py old mode 100644 new mode 100755 index 70bb8c38f..7f721a534 --- 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): -- cgit