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)
(cherry picked from commit e49075dfee)
(cherry picked from commit 4ac14e017b)
(cherry picked from commit edab20c26f)
(cherry picked from commit 4dff4e37c2)
changes/90/744390/1
Goutham Pacha Ravi 2 months ago
parent
commit
28f0e84191
3 changed files with 34 additions and 0 deletions
  1. +8
    -0
      manila/share/driver.py
  2. +20
    -0
      manila/tests/share/test_driver.py
  3. +6
    -0
      releasenotes/notes/bug-1888905-fix-group-snapshot-create-delete-0595f9d7a4c0c343.yaml

+ 8
- 0
manila/share/driver.py View File

@@ -1348,6 +1348,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,
@@ -1390,6 +1392,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'],
@@ -1452,6 +1456,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,
@@ -1479,6 +1485,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
- 0
manila/tests/share/test_driver.py View File

@@ -809,6 +809,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,
@@ -821,6 +823,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',
@@ -859,6 +863,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'],
@@ -881,6 +887,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,
@@ -893,6 +901,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',
@@ -932,6 +942,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'],
@@ -945,6 +957,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'],
@@ -1020,6 +1034,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,
@@ -1032,6 +1048,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',
@@ -1070,6 +1088,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
- 0
releasenotes/notes/bug-1888905-fix-group-snapshot-create-delete-0595f9d7a4c0c343.yaml View File

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