Browse Source

Fix fallback share group snapshot implementation

When a share driver does not provide the capability
to create share group snapshots, the share manager
iterates over the shares in the group and invokes the
driver method to snapshot the shares. However, the
create and delete routines in this fallback path
did not include some attributes necessary for the
operation in many drivers.

Change-Id: Id5a9467247df1d8f0ec6dee3fae842ba673c34ed
Closes-Bug: #1888905
Signed-off-by: Goutham Pacha Ravi <gouthampravi@gmail.com>
(cherry picked from commit a398743264)
changes/75/743675/1
Goutham Pacha Ravi 1 year ago
parent
commit
e49075dfee
  1. 8
      manila/share/driver.py
  2. 20
      manila/tests/share/test_driver.py
  3. 6
      releasenotes/notes/bug-1888905-fix-group-snapshot-create-delete-0595f9d7a4c0c343.yaml

8
manila/share/driver.py

@ -1560,6 +1560,8 @@ class ShareDriver(object):
'share': <models.Share>,
'updated_at': datetime.datetime(2015, 8, 10, 0, 5, 58),
'share_proto': 'NFS',
'share_name': 'share_some_fake_uuid',
'name': 'share-snapshot-some_fake_uuid',
'project_id': '13c0be6290934bd98596cfa004650049',
'share_group_snapshot_id': 'some_fake_uuid',
'deleted_at': None,
@ -1602,6 +1604,8 @@ class ShareDriver(object):
'share_instance_id': member['share']['id'],
'id': member['id'],
'share': member['share'],
'share_name': member['share_name'],
'name': member['name'],
'size': member['share']['size'],
'share_size': member['share']['size'],
'share_proto': member['share']['share_proto'],
@ -1664,6 +1668,8 @@ class ShareDriver(object):
'share': <models.Share>,
'updated_at': datetime.datetime(2015, 8, 10, 0, 5, 58),
'share_proto': 'NFS',
'share_name':'share_some_fake_uuid',
'name': 'share-snapshot-some_fake_uuid',
'project_id': '13c0be6290934bd98596cfa004650049',
'share_group_snapshot_id': 'some_fake_uuid',
'deleted_at': None,
@ -1691,6 +1697,8 @@ class ShareDriver(object):
'id': member['id'],
'share': member['share'],
'size': member['share']['size'],
'share_name': member['share_name'],
'name': member['name'],
'share_size': member['share']['size'],
'share_proto': member['share']['share_proto'],
'provider_location': member['provider_location'],

20
manila/tests/share/test_driver.py

@ -907,6 +907,8 @@ class ShareDriverTestCase(test.TestCase):
'share_group_snapshot_id': 'fake_share_group_snapshot_id',
'share_instance_id': 'fake_share_instance_id_1',
'provider_location': 'should_not_be_used_1',
'share_name': 'share_fake_share_instance_id_1',
'name': 'share-snapshot-6813e06b-a8f5-4784-b17d-f3e91afa370e',
'share': {
'id': '420f978b-dbf6-4b3c-92fe-f5b17a0bb5e2',
'size': 3,
@ -919,6 +921,8 @@ class ShareDriverTestCase(test.TestCase):
'share_group_snapshot_id': 'fake_share_group_snapshot_id',
'share_instance_id': 'fake_share_instance_id_2',
'provider_location': 'should_not_be_used_2',
'share_name': 'share_fake_share_instance_id_2',
'name': 'share-snapshot-1e010dfe-545b-432d-ab95-4ef03cd82f89',
'share': {
'id': '420f978b-dbf6-4b3c-92fe-f5b17a0bb5e2',
'size': '2',
@ -957,6 +961,8 @@ class ShareDriverTestCase(test.TestCase):
'share_instance_id': member['share']['id'],
'id': member['id'],
'share': member['share'],
'share_name': member['share_name'],
'name': member['name'],
'size': member['share']['size'],
'share_size': member['share']['size'],
'share_proto': member['share']['share_proto'],
@ -979,6 +985,8 @@ class ShareDriverTestCase(test.TestCase):
'share_group_snapshot_id': 'fake_share_group_snapshot_id',
'share_instance_id': 'fake_share_instance_id_1',
'provider_location': 'should_not_be_used_1',
'share_name': 'share_fake_share_instance_id_1',
'name': 'share-snapshot-6813e06b-a8f5-4784-b17d-f3e91afa370e',
'share': {
'id': '420f978b-dbf6-4b3c-92fe-f5b17a0bb5e2',
'size': 3,
@ -991,6 +999,8 @@ class ShareDriverTestCase(test.TestCase):
'share_group_snapshot_id': 'fake_share_group_snapshot_id',
'share_instance_id': 'fake_share_instance_id_2',
'provider_location': 'should_not_be_used_2',
'share_name': 'share_fake_share_instance_id_2',
'name': 'share-snapshot-1e010dfe-545b-432d-ab95-4ef03cd82f89',
'share': {
'id': '420f978b-dbf6-4b3c-92fe-f5b17a0bb5e2',
'size': '2',
@ -1030,6 +1040,8 @@ class ShareDriverTestCase(test.TestCase):
'share_instance_id': fake_snap_member_1['share']['id'],
'id': fake_snap_member_1['id'],
'share': fake_snap_member_1['share'],
'share_name': fake_snap_member_1['share_name'],
'name': fake_snap_member_1['name'],
'size': fake_snap_member_1['share']['size'],
'share_size': fake_snap_member_1['share']['size'],
'share_proto': fake_snap_member_1['share']['share_proto'],
@ -1043,6 +1055,8 @@ class ShareDriverTestCase(test.TestCase):
'share_instance_id': member['share']['id'],
'id': member['id'],
'share': member['share'],
'share_name': member['share_name'],
'name': member['name'],
'size': member['share']['size'],
'share_size': member['share']['size'],
'share_proto': member['share']['share_proto'],
@ -1118,6 +1132,8 @@ class ShareDriverTestCase(test.TestCase):
'share_group_snapshot_id': 'fake_share_group_snapshot_id',
'share_instance_id': 'fake_share_instance_id_1',
'provider_location': 'fake_provider_location_2',
'share_name': 'share_fake_share_instance_id_1',
'name': 'share-snapshot-6813e06b-a8f5-4784-b17d-f3e91afa370e',
'share': {
'id': '420f978b-dbf6-4b3c-92fe-f5b17a0bb5e2',
'size': 3,
@ -1130,6 +1146,8 @@ class ShareDriverTestCase(test.TestCase):
'share_group_snapshot_id': 'fake_share_group_snapshot_id',
'share_instance_id': 'fake_share_instance_id_2',
'provider_location': 'fake_provider_location_2',
'share_name': 'share_fake_provider_location_2',
'name': 'share-snapshot-1e010dfe-545b-432d-ab95-4ef03cd82f89',
'share': {
'id': '420f978b-dbf6-4b3c-92fe-f5b17a0bb5e2',
'size': '2',
@ -1168,6 +1186,8 @@ class ShareDriverTestCase(test.TestCase):
'share': member['share'],
'size': member['share']['size'],
'share_size': member['share']['size'],
'share_name': member['share_name'],
'name': member['name'],
'share_proto': member['share']['share_proto'],
'provider_location': member['provider_location']},
share_server=None)

6
releasenotes/notes/bug-1888905-fix-group-snapshot-create-delete-0595f9d7a4c0c343.yaml

@ -0,0 +1,6 @@
---
fixes:
- |
An error with share group snapshot creation and deletion due to missing
attributes has been fixed. See `Launchpad bug 1888905
<https://launchpad.net/bugs/1888905>`_ for more information.
Loading…
Cancel
Save