Merge "Remove deprecated change phys disk state results"
This commit is contained in:
commit
e902ced872
@ -1184,13 +1184,6 @@ class DRACClient(object):
|
||||
- The is_reboot_required key with a RebootRequired
|
||||
enumerated value indicating whether the server must be
|
||||
rebooted to complete disk conversion.
|
||||
Also contained in the main dict are the following key/values,
|
||||
which are deprecated, should not be used, and will be removed
|
||||
in a future release:
|
||||
- is_reboot_required, a boolean stating whether a reboot is
|
||||
required or not.
|
||||
- commit_required_ids, a list of controller ids that will
|
||||
need to commit their pending RAID changes via a config job.
|
||||
:raises: DRACOperationFailed on error reported back by the DRAC and the
|
||||
exception message does not contain NOT_SUPPORTED_MSG constant.
|
||||
:raises: Exception on unknown error.
|
||||
|
@ -925,13 +925,6 @@ class RAIDManagement(object):
|
||||
- The is_reboot_required key with a RebootRequired
|
||||
enumerated value indicating whether the server must be
|
||||
rebooted to complete disk conversion.
|
||||
Also contained in the main dict are the following key/values,
|
||||
which are deprecated, should not be used, and will be removed
|
||||
in a future release:
|
||||
- is_reboot_required, a boolean stating whether a reboot is
|
||||
required or not.
|
||||
- commit_required_ids, a list of controller ids that will
|
||||
need to commit their pending RAID changes via a config job.
|
||||
:raises: DRACOperationFailed on error reported back by the DRAC and the
|
||||
exception message does not contain NOT_SUPPORTED_MSG constant.
|
||||
:raises: Exception on unknown error.
|
||||
@ -961,8 +954,6 @@ class RAIDManagement(object):
|
||||
final_ctls_to_phys_disk_ids = self._check_disks_status(
|
||||
mode, physical_disks, controllers_to_physical_disk_ids)
|
||||
|
||||
is_reboot_required = False
|
||||
controllers = []
|
||||
controllers_to_results = {}
|
||||
for controller, physical_disk_ids \
|
||||
in final_ctls_to_phys_disk_ids.items():
|
||||
@ -989,17 +980,6 @@ class RAIDManagement(object):
|
||||
raise
|
||||
else:
|
||||
controllers_to_results[controller] = conversion_results
|
||||
|
||||
# Remove the code below when is_reboot_required and
|
||||
# commit_required_ids are deprecated
|
||||
reboot_true = constants.RebootRequired.true
|
||||
reboot_optional = constants.RebootRequired.optional
|
||||
_is_reboot_required = \
|
||||
conversion_results["is_reboot_required"]
|
||||
is_reboot_required = is_reboot_required \
|
||||
or (_is_reboot_required
|
||||
in [reboot_true, reboot_optional])
|
||||
controllers.append(controller)
|
||||
else:
|
||||
controllers_to_results[controller] = \
|
||||
utils.build_return_dict(
|
||||
@ -1009,9 +989,7 @@ class RAIDManagement(object):
|
||||
is_reboot_required_value=constants.
|
||||
RebootRequired.false)
|
||||
|
||||
return {'conversion_results': controllers_to_results,
|
||||
'is_reboot_required': is_reboot_required,
|
||||
'commit_required_ids': controllers}
|
||||
return {'conversion_results': controllers_to_results}
|
||||
|
||||
def is_realtime_supported(self, raid_controller_fqdd):
|
||||
"""Find if controller supports realtime or not
|
||||
|
@ -1345,8 +1345,6 @@ class ClientRAIDManagementTestCase(base.BaseTest):
|
||||
cvt_phys_disks_return_value}
|
||||
results = self.drac_client.change_physical_disk_state(
|
||||
mode, self.controllers_to_physical_disk_ids)
|
||||
self.assertTrue(results["is_reboot_required"])
|
||||
self.assertEqual(len(results["commit_required_ids"]), 2)
|
||||
self.assertEqual(results['conversion_results'],
|
||||
expected_return_value)
|
||||
|
||||
@ -1376,8 +1374,6 @@ class ClientRAIDManagementTestCase(base.BaseTest):
|
||||
|
||||
results = self.drac_client.change_physical_disk_state(
|
||||
mode, self.controllers_to_physical_disk_ids)
|
||||
self.assertTrue(results["is_reboot_required"])
|
||||
self.assertEqual(len(results["commit_required_ids"]), 1)
|
||||
self.assertEqual(len(results['conversion_results']), 2)
|
||||
self.assertEqual(results['conversion_results']['AHCI.Integrated.1-1'],
|
||||
boss_return_value)
|
||||
@ -1398,8 +1394,6 @@ class ClientRAIDManagementTestCase(base.BaseTest):
|
||||
constants.RebootRequired.false}
|
||||
results = self.drac_client.change_physical_disk_state(
|
||||
mode, self.controllers_to_physical_disk_ids)
|
||||
self.assertFalse(results["is_reboot_required"])
|
||||
self.assertEqual(len(results["commit_required_ids"]), 0)
|
||||
self.assertEqual(results['conversion_results']['RAID.Integrated.1-1'],
|
||||
expected_return_value)
|
||||
self.assertEqual(results['conversion_results']['AHCI.Integrated.1-1'],
|
||||
@ -1428,8 +1422,6 @@ class ClientRAIDManagementTestCase(base.BaseTest):
|
||||
constants.RebootRequired.false}
|
||||
results = self.drac_client.change_physical_disk_state(
|
||||
mode, self.controllers_to_physical_disk_ids)
|
||||
self.assertFalse(results["is_reboot_required"])
|
||||
self.assertEqual(len(results["commit_required_ids"]), 0)
|
||||
self.assertEqual(results['conversion_results']['RAID.Integrated.1-1'],
|
||||
expected_return_value)
|
||||
self.assertEqual(results['conversion_results']['AHCI.Integrated.1-1'],
|
||||
@ -1503,14 +1495,18 @@ class ClientRAIDManagementTestCase(base.BaseTest):
|
||||
text=test_utils.RAIDEnumerations[uris.DCIM_ControllerView]['ok'])
|
||||
mode = constants.RaidStatus.jbod
|
||||
physical_disks = [self.disk_1, self.disk_2, self.disk_3, self.disk_4]
|
||||
mock_convert_physical_disks.return_value = {'is_commit_required': True,
|
||||
'is_reboot_required':
|
||||
constants.RebootRequired
|
||||
.true}
|
||||
mock_list_physical_disks.return_value = physical_disks
|
||||
cvt_phys_disks_return_value = {'is_commit_required': True,
|
||||
'is_reboot_required': constants.
|
||||
RebootRequired.true}
|
||||
mock_convert_physical_disks.return_value = cvt_phys_disks_return_value
|
||||
expected_return_value = {'RAID.Integrated.1-1':
|
||||
cvt_phys_disks_return_value,
|
||||
'AHCI.Integrated.1-1':
|
||||
cvt_phys_disks_return_value}
|
||||
results = self.drac_client.change_physical_disk_state(mode)
|
||||
self.assertTrue(results["is_reboot_required"])
|
||||
self.assertEqual(len(results["commit_required_ids"]), 2)
|
||||
self.assertDictEqual(results['conversion_results'],
|
||||
expected_return_value)
|
||||
|
||||
@mock.patch.object(dracclient.client.WSManClient,
|
||||
'wait_until_idrac_is_ready', spec_set=True,
|
||||
@ -1533,8 +1529,7 @@ class ClientRAIDManagementTestCase(base.BaseTest):
|
||||
physical_disks = [_disk_1, _disk_2, _disk_3, _disk_4]
|
||||
mock_list_physical_disks.return_value = physical_disks
|
||||
results = self.drac_client.change_physical_disk_state(mode)
|
||||
self.assertFalse(results["is_reboot_required"])
|
||||
self.assertEqual(len(results["commit_required_ids"]), 0)
|
||||
self.assertDictEqual(results['conversion_results'], {})
|
||||
|
||||
@mock.patch.object(dracclient.client.WSManClient,
|
||||
'wait_until_idrac_is_ready', spec_set=True,
|
||||
|
Loading…
Reference in New Issue
Block a user