From 3c36cbdbc83c1fe1e83fb0733101f84a7a61a0f7 Mon Sep 17 00:00:00 2001 From: Zhongyue Luo Date: Sat, 11 May 2013 21:25:16 +0800 Subject: 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 --- nova/utils.py | 3 +++ 1 file changed, 3 insertions(+) (limited to 'nova/utils.py') 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. -- cgit