From 21925b63af87c36be97eec5b212e06477471bb1e Mon Sep 17 00:00:00 2001 From: Pedro Navarro Perez Date: Tue, 12 Mar 2013 04:24:51 -0700 Subject: Fix locking issues in Windows The Windows Storage Cinder plugin through the Windows Locks implementation of the InterProcessLock fails in attaching/detaching operations. Change-Id: I682205592e152b3222e04ca3221d25594d134dd9 Fixes: bug #1153966 --- openstack/common/lockutils.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'openstack/common/lockutils.py') diff --git a/openstack/common/lockutils.py b/openstack/common/lockutils.py index 0c60ed7..dd0956e 100644 --- a/openstack/common/lockutils.py +++ b/openstack/common/lockutils.py @@ -107,10 +107,10 @@ class _InterProcessLock(object): class _WindowsLock(_InterProcessLock): def trylock(self): - msvcrt.locking(self.lockfile, msvcrt.LK_NBLCK, 1) + msvcrt.locking(self.lockfile.fileno(), msvcrt.LK_NBLCK, 1) def unlock(self): - msvcrt.locking(self.lockfile, msvcrt.LK_UNLCK, 1) + msvcrt.locking(self.lockfile.fileno(), msvcrt.LK_UNLCK, 1) class _PosixLock(_InterProcessLock): -- cgit