summaryrefslogtreecommitdiffstats
path: root/nova/utils.py
diff options
context:
space:
mode:
authorZhongyue Luo <zhongyue.nah@intel.com>2013-05-11 21:25:16 +0800
committerZhongyue Luo <zhongyue.nah@intel.com>2013-05-14 15:01:45 +0800
commit3c36cbdbc83c1fe1e83fb0733101f84a7a61a0f7 (patch)
treed3a556517225e3ab5451dbcb4a0bda8ac6568c72 /nova/utils.py
parent966c6fbdfc038ff5d5d01b7ea29e83bddbb083bf (diff)
downloadnova-3c36cbdbc83c1fe1e83fb0733101f84a7a61a0f7.tar.gz
nova-3c36cbdbc83c1fe1e83fb0733101f84a7a61a0f7.tar.xz
nova-3c36cbdbc83c1fe1e83fb0733101f84a7a61a0f7.zip
Hide lock_prefix argument using synchronized_with_prefix()
The lockfile module has a new convenience API which sets the lockfile prefix. Using this API, the prefix is not required everytime synchronized is used. Change-Id: Iac1cfcc83b59108164de924d20127c1cf4dd7dcd
Diffstat (limited to 'nova/utils.py')
-rw-r--r--nova/utils.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/nova/utils.py b/nova/utils.py
index aaa46d31e..3af79a6df 100644
--- a/nova/utils.py
+++ b/nova/utils.py
@@ -44,6 +44,7 @@ from oslo.config import cfg
from nova import exception
from nova.openstack.common import excutils
from nova.openstack.common import importutils
+from nova.openstack.common import lockutils
from nova.openstack.common import log as logging
from nova.openstack.common import processutils
from nova.openstack.common.rpc import common as rpc_common
@@ -97,6 +98,8 @@ BYTE_MULTIPLIERS = {
'k': 1024,
}
+synchronized = lockutils.synchronized_with_prefix('nova-')
+
def vpn_ping(address, port, timeout=0.05, session_id=None):
"""Sends a vpn negotiation packet and returns the server session.