summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-03-25 17:37:15 +0000
committerGerrit Code Review <review@openstack.org>2013-03-25 17:37:15 +0000
commit1f585066be59a28136aadb8ae1f99a8562616537 (patch)
tree7394bd0e31bcf8b0cbe6a939aa7a6401b9918a33
parent0a8834d700d7d481e06a4e31114b9c8d1b08988b (diff)
parent817bdebb7cda941182d50d6edd14b56c2aec0ded (diff)
downloadnova-1f585066be59a28136aadb8ae1f99a8562616537.tar.gz
Merge "Sync lockutils from oslo-incubator stable/grizzly." into milestone-proposed
-rw-r--r--nova/openstack/common/lockutils.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/nova/openstack/common/lockutils.py b/nova/openstack/common/lockutils.py
index 3270f04736..e1af8bac70 100644
--- a/nova/openstack/common/lockutils.py
+++ b/nova/openstack/common/lockutils.py
@@ -1,6 +1,6 @@
# vim: tabstop=4 shiftwidth=4 softtabstop=4
-# Copyright 2011 OpenStack Foundation
+# Copyright 2011 OpenStack Foundation.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
@@ -32,6 +32,7 @@ from nova.openstack.common.gettextutils import _
from nova.openstack.common import local
from nova.openstack.common import log as logging
+
LOG = logging.getLogger(__name__)
@@ -106,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):
@@ -206,7 +207,6 @@ def synchronized(name, lock_file_prefix, external=False, lock_path=None):
local_lock_path = tempfile.mkdtemp()
if not os.path.exists(local_lock_path):
- cleanup_dir = True
fileutils.ensure_tree(local_lock_path)
# NOTE(mikal): the lock name cannot contain directory