Remove deprecated [disk_utils]iscsi_verify_attempts

The configuration option [disk_utils]iscsi_verify_attempts was
deprecated and marked for removal.

Change-Id: I8e67430ba6c53420b7ad38b21adcf776d0c77ad0
This commit is contained in:
Riccardo Pittau 2020-01-03 11:11:01 +01:00
parent b849d0ff42
commit bf44ded88a
3 changed files with 10 additions and 23 deletions

View File

@ -51,19 +51,10 @@ opts = [
cfg.StrOpt('dd_block_size',
default='1M',
help='Block size to use when writing to the nodes disk.'),
# TODO(dtantsur): remove in Ussuri, then clean up ironic from it.
cfg.IntOpt('iscsi_verify_attempts',
default=3,
help='Maximum attempts to verify an iSCSI connection is '
'active, sleeping 1 second between attempts.',
deprecated_for_removal=True,
deprecated_reason='Split into [iscsi]verify_attempts and '
'partition_detection_attempts.'),
cfg.IntOpt('partition_detection_attempts',
default=3,
min=1,
help='Maximum attempts to detect a newly created partition. '
'Defaults to iscsi_verify_attempts, will default to 3 '
'when it is removed.'),
help='Maximum attempts to detect a newly created partition.'),
cfg.IntOpt('partprobe_attempts',
default=10,
help='Maximum number of attempts to try to read the '
@ -344,9 +335,7 @@ def make_partitions(dev, root_mb, swap_mb, ephemeral_mb,
def is_block_device(dev):
"""Check whether a device is block or not."""
attempts = (CONF.disk_utils.iscsi_verify_attempts
if CONF.disk_utils.partition_detection_attempts is None
else CONF.disk_utils.partition_detection_attempts)
attempts = CONF.disk_utils.partition_detection_attempts
for attempt in range(attempts):
try:
s = os.stat(dev)

View File

@ -1009,15 +1009,6 @@ class OtherFunctionTestCase(base.IronicLibTestCase):
disk_utils.is_block_device, device)
mock_os.assert_has_calls([mock.call(device)] * 2)
@mock.patch.object(os, 'stat', autospec=True)
def test_is_block_device_deprecated_attempts(self, mock_os):
CONF.set_override('iscsi_verify_attempts', 4, group='disk_utils')
device = '/dev/disk/by-path/ip-1.2.3.4:5678-iscsi-iqn.fake-lun-9'
mock_os.side_effect = OSError
self.assertRaises(exception.InstanceDeployFailure,
disk_utils.is_block_device, device)
mock_os.assert_has_calls([mock.call(device)] * 4)
@mock.patch.object(imageutils, 'QemuImgInfo', autospec=True)
@mock.patch.object(os.path, 'exists', return_value=False, autospec=True)
def test_qemu_img_info_path_doesnt_exist(self, path_exists_mock,

View File

@ -0,0 +1,7 @@
---
upgrade:
- |
The configuration option ``[disk_utils]iscsi_verify_attempts was
deprecated in Train and it's now removed.
Please use the ``[disk_utils]partition_detection_attempts``
option instead.