Merge "Fix Snapshot object metadata loading"
This commit is contained in:
commit
81eb9f352a
cinder
@ -95,7 +95,7 @@ class Snapshot(cleanable.CinderCleanableObject, base.CinderObject,
|
|||||||
|
|
||||||
def __init__(self, *args, **kwargs):
|
def __init__(self, *args, **kwargs):
|
||||||
super(Snapshot, self).__init__(*args, **kwargs)
|
super(Snapshot, self).__init__(*args, **kwargs)
|
||||||
self._orig_metadata = {}
|
self.metadata = kwargs.get('metadata', {})
|
||||||
|
|
||||||
self._reset_metadata_tracking()
|
self._reset_metadata_tracking()
|
||||||
|
|
||||||
|
@ -167,6 +167,7 @@ class TestSnapshot(test_objects.BaseObjectsTestCase):
|
|||||||
self.assertEqual(volume, snapshot.volume)
|
self.assertEqual(volume, snapshot.volume)
|
||||||
volume_get_by_id.assert_called_once_with(self.context,
|
volume_get_by_id.assert_called_once_with(self.context,
|
||||||
snapshot.volume_id)
|
snapshot.volume_id)
|
||||||
|
self.assertEqual(snapshot.metadata, {})
|
||||||
# Test cgsnapshot lazy-loaded field
|
# Test cgsnapshot lazy-loaded field
|
||||||
cgsnapshot = objects.CGSnapshot(context=self.context,
|
cgsnapshot = objects.CGSnapshot(context=self.context,
|
||||||
id=fake.CGSNAPSHOT_ID)
|
id=fake.CGSNAPSHOT_ID)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user