Merge "NetApp OnTap: Fix compatibility check for share migrate"

This commit is contained in:
Zuul 2021-12-15 23:54:48 +00:00 committed by Gerrit Code Review
commit c29fa635a1
3 changed files with 32 additions and 7 deletions

View File

@ -4917,16 +4917,18 @@ class NetAppCmodeClient(client_base.NetAppBaseClient):
'cutover-action': CUTOVER_ACTION_MAP[cutover_action],
}
if self.features.FLEXVOL_ENCRYPTION and encrypt_destination:
api_args['encrypt-destination'] = 'true'
if self.features.FLEXVOL_ENCRYPTION:
if encrypt_destination:
api_args['encrypt-destination'] = 'true'
else:
api_args['encrypt-destination'] = 'false'
elif encrypt_destination:
msg = 'Flexvol encryption is not supported on this backend.'
raise exception.NetAppException(msg)
else:
api_args['encrypt-destination'] = 'false'
if validation_only:
api_args['perform-validation-only'] = 'true'
self.send_request('volume-move-start', api_args)
@na_utils.trace

View File

@ -7185,8 +7185,19 @@ class NetAppClientCmodeTestCase(test.TestCase):
expected = [fake.SNAPSHOT_NAME]
self.assertEqual(expected, result)
@ddt.data('start_volume_move', 'check_volume_move')
def test_volume_move_method(self, method_name):
@ddt.data(
{'method_name': 'start_volume_move', 'ontapi_version': (1, 20)},
{'method_name': 'start_volume_move', 'ontapi_version': (1, 110)},
{'method_name': 'check_volume_move', 'ontapi_version': (1, 20)},
{'method_name': 'check_volume_move', 'ontapi_version': (1, 110)}
)
@ddt.unpack
def test_volume_move_method(self, method_name, ontapi_version):
self.mock_object(client_base.NetAppBaseClient,
'get_ontapi_version',
mock.Mock(return_value=ontapi_version))
self.client._init_features()
method = getattr(self.client, method_name)
self.mock_object(self.client, 'send_request')
@ -7199,8 +7210,14 @@ class NetAppClientCmodeTestCase(test.TestCase):
'vserver': fake.VSERVER_NAME,
'dest-aggr': fake.SHARE_AGGREGATE_NAME,
'cutover-action': 'wait',
'encrypt-destination': 'false'
}
if ontapi_version >= (1, 110):
expected_api_args['encrypt-destination'] = 'false'
self.assertTrue(self.client.features.FLEXVOL_ENCRYPTION)
else:
self.assertFalse(self.client.features.FLEXVOL_ENCRYPTION)
if method_name.startswith('check'):
expected_api_args['perform-validation-only'] = 'true'

View File

@ -0,0 +1,6 @@
---
fixes:
- |
NetApp OnTap driver `Bug #1915237
<https://bugs.launchpad.net/manila/+bug/1915237>`_:
Fixed encryption compatibility check on manila share migrate.