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
This commit is contained in:
Dan Smith 2015-07-15 10:44:33 -07:00
parent 868282223b
commit 4ba2e4c414

View File

@ -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')