From 4ba2e4c4146f9864d948d61ef0b85bb2b75636b6 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Wed, 15 Jul 2015 10:44:33 -0700 Subject: [PATCH] Move to using ovo's remotable decorators This removes Nova's remotable and remotable_classmethod decorators and aliases the old location to the oslo.versionedobjects (ovo) implementations. This uncovered a couple other places where we were still passing a context to a remotable method (in tests), which are fixed up here. There is also a bug in ovo's remotable decorator that requires dict compatibility. For this reason, this patch adds the Dict mixin to a few objects (with appropriate comments), which can be removed when we have an ovo release with that fix in it. Related to blueprint use-oslo-objects Change-Id: Id51fa3a55f65c8c075423f50a1240c997f9f2388 --- nova/tests/unit/objects/test_aggregate.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/nova/tests/unit/objects/test_aggregate.py b/nova/tests/unit/objects/test_aggregate.py index 476955aa2..6e74395ce 100644 --- a/nova/tests/unit/objects/test_aggregate.py +++ b/nova/tests/unit/objects/test_aggregate.py @@ -65,8 +65,7 @@ class _TestAggregateObject(object): agg.name = 'foo' agg.metadata = {'one': 'two'} agg.create() - self.assertRaises(exception.ObjectActionError, agg.create, - self.context) + self.assertRaises(exception.ObjectActionError, agg.create) def test_save(self): self.mox.StubOutWithMock(db, 'aggregate_update') @@ -80,13 +79,13 @@ class _TestAggregateObject(object): self.compare_obj(agg, fake_aggregate, subs=SUBS) def test_save_and_create_no_hosts(self): - agg = aggregate.Aggregate() + agg = aggregate.Aggregate(context=self.context) agg.id = 123 agg.hosts = ['foo', 'bar'] self.assertRaises(exception.ObjectActionError, - agg.create, self.context) + agg.create) self.assertRaises(exception.ObjectActionError, - agg.save, self.context) + agg.save) def test_update_metadata(self): self.mox.StubOutWithMock(db, 'aggregate_metadata_delete')