glusterfs: Fix use of ShareSnapshotInstance object
Previously, a 'ShareSnapshot' object was passed to the driver's API method by share's manager.py during a create_share_from_snapshot call. Now, a 'ShareSnapshotInstance' object is passed to the driver during the same call. The object no longer has the attribute 'share' used by the driver code, and in it's place has the attribute 'share_instance'. So replace use of 'share' attribute with 'share_instance'. Change-Id: Ibea11b33772f24609f9cd3180d61ab7f6307c1b8 Closes-Bug: #1495382
This commit is contained in:
parent
94e62e1a41
commit
cf7bc890fc
|
@ -445,7 +445,7 @@ class GlusterfsVolumeMappedLayout(layout.GlusterfsShareLayoutBase):
|
|||
|
||||
def create_share_from_snapshot(self, context, share, snapshot,
|
||||
share_server=None):
|
||||
old_gmgr = self._share_manager(snapshot['share'])
|
||||
old_gmgr = self._share_manager(snapshot['share_instance'])
|
||||
|
||||
# Snapshot clone feature in GlusterFS server essential to support this
|
||||
# API is available in GlusterFS server versions 3.7 and higher. So do
|
||||
|
|
|
@ -687,7 +687,7 @@ class GlusterfsVolumeMappedLayoutTestCase(test.TestCase):
|
|||
share = new_share()
|
||||
snapshot = {
|
||||
'id': 'fake_snap_id',
|
||||
'share': new_share(export_location=glusterfs_target)
|
||||
'share_instance': new_share(export_location=glusterfs_target)
|
||||
}
|
||||
volume = ''.join(['manila-', share['id']])
|
||||
new_export_location = ':/'.join([glusterfs_server, volume])
|
||||
|
@ -721,7 +721,7 @@ class GlusterfsVolumeMappedLayoutTestCase(test.TestCase):
|
|||
('snapshot', 'clone', volume, 'fake_snap_id_xyz'))
|
||||
old_gmgr.gluster_call.assert_has_calls([mock.call(*a) for a in args])
|
||||
self._layout._share_manager.assert_called_once_with(
|
||||
snapshot['share'])
|
||||
snapshot['share_instance'])
|
||||
self._layout._glustermanager.assert_called_once_with(
|
||||
gmgr.parse(new_export_location))
|
||||
self._layout.driver._setup_via_manager.assert_called_once_with(
|
||||
|
@ -760,7 +760,7 @@ class GlusterfsVolumeMappedLayoutTestCase(test.TestCase):
|
|||
|
||||
snapshot = {
|
||||
'id': 'fake_snap_id',
|
||||
'share': new_share(export_location=glusterfs_target)
|
||||
'share_instance': new_share(export_location=glusterfs_target)
|
||||
}
|
||||
self.assertRaises(exception.GlusterfsException,
|
||||
self._layout.create_share_from_snapshot,
|
||||
|
@ -773,7 +773,7 @@ class GlusterfsVolumeMappedLayoutTestCase(test.TestCase):
|
|||
('snapshot', 'clone', volume, 'fake_snap_id_xyz'))
|
||||
old_gmgr.gluster_call.assert_has_calls([mock.call(*a) for a in args])
|
||||
self._layout._share_manager.assert_called_once_with(
|
||||
snapshot['share'])
|
||||
snapshot['share_instance'])
|
||||
self.assertFalse(new_gmgr.get_gluster_vol_option.called)
|
||||
self.assertFalse(new_gmgr.gluster_call.called)
|
||||
self.assertNotIn(new_export_location,
|
||||
|
@ -810,7 +810,7 @@ class GlusterfsVolumeMappedLayoutTestCase(test.TestCase):
|
|||
|
||||
snapshot = {
|
||||
'id': 'fake_snap_id',
|
||||
'share': new_share(export_location=glusterfs_target)
|
||||
'share_instance': new_share(export_location=glusterfs_target)
|
||||
}
|
||||
self.assertRaises(exception.GlusterfsException,
|
||||
self._layout.create_share_from_snapshot,
|
||||
|
@ -820,7 +820,7 @@ class GlusterfsVolumeMappedLayoutTestCase(test.TestCase):
|
|||
self._layout._find_actual_backend_snapshot_name.called)
|
||||
self.assertFalse(old_gmgr.gluster_call.called)
|
||||
self._layout._share_manager.assert_called_once_with(
|
||||
snapshot['share'])
|
||||
snapshot['share_instance'])
|
||||
self.assertFalse(self._layout._glustermanager.called)
|
||||
self.assertFalse(new_gmgr.get_gluster_vol_option.called)
|
||||
self.assertFalse(new_gmgr.gluster_call.called)
|
||||
|
|
Loading…
Reference in New Issue