summaryrefslogtreecommitdiffstats
path: root/nova/tests
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/tests
parent966c6fbdfc038ff5d5d01b7ea29e83bddbb083bf (diff)
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/tests')
-rw-r--r--nova/tests/test_imagebackend.py4
-rw-r--r--nova/tests/test_migrations.py4
2 files changed, 4 insertions, 4 deletions
diff --git a/nova/tests/test_imagebackend.py b/nova/tests/test_imagebackend.py
index 0f1d8532b..b5d64a218 100644
--- a/nova/tests/test_imagebackend.py
+++ b/nova/tests/test_imagebackend.py
@@ -161,7 +161,7 @@ class RawTestCase(_ImageTestCase, test.TestCase):
def prepare_mocks(self):
fn = self.mox.CreateMockAnything()
- self.mox.StubOutWithMock(imagebackend.lockutils.synchronized,
+ self.mox.StubOutWithMock(imagebackend.utils.synchronized,
'__call__')
self.mox.StubOutWithMock(imagebackend.libvirt_utils, 'copy_image')
self.mox.StubOutWithMock(imagebackend.disk, 'extend')
@@ -230,7 +230,7 @@ class Qcow2TestCase(_ImageTestCase, test.TestCase):
def prepare_mocks(self):
fn = self.mox.CreateMockAnything()
- self.mox.StubOutWithMock(imagebackend.lockutils.synchronized,
+ self.mox.StubOutWithMock(imagebackend.utils.synchronized,
'__call__')
self.mox.StubOutWithMock(imagebackend.libvirt_utils,
'create_cow_image')
diff --git a/nova/tests/test_migrations.py b/nova/tests/test_migrations.py
index d4b384089..d7ef3da2f 100644
--- a/nova/tests/test_migrations.py
+++ b/nova/tests/test_migrations.py
@@ -59,10 +59,10 @@ import sqlalchemy.exc
from nova.db.sqlalchemy import api as db
import nova.db.sqlalchemy.migrate_repo
from nova.db.sqlalchemy import utils as db_utils
-from nova.openstack.common import lockutils
from nova.openstack.common import log as logging
from nova.openstack.common import timeutils
from nova import test
+from nova import utils
import nova.virt.baremetal.db.sqlalchemy.migrate_repo
@@ -246,7 +246,7 @@ class BaseMigrationTestCase(test.TestCase):
self.assertEqual(0, status,
"Failed to run: %s\n%s" % (cmd, output))
- @lockutils.synchronized('pgadmin', 'nova-', external=True)
+ @utils.synchronized('pgadmin', external=True)
def _reset_pg(self, conn_pieces):
(user, password, database, host) = \
get_pgsql_connection_info(conn_pieces)