diff --git a/ironic_lib/disk_utils.py b/ironic_lib/disk_utils.py index 1b9b8bb4..f8706020 100644 --- a/ironic_lib/disk_utils.py +++ b/ironic_lib/disk_utils.py @@ -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) diff --git a/ironic_lib/tests/test_disk_utils.py b/ironic_lib/tests/test_disk_utils.py index 1e6b7d9e..387f5f2e 100644 --- a/ironic_lib/tests/test_disk_utils.py +++ b/ironic_lib/tests/test_disk_utils.py @@ -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, diff --git a/releasenotes/notes/remove-iscsi-verify-attempts-ff9eb5b7a28e6143.yaml b/releasenotes/notes/remove-iscsi-verify-attempts-ff9eb5b7a28e6143.yaml new file mode 100644 index 00000000..c4f44890 --- /dev/null +++ b/releasenotes/notes/remove-iscsi-verify-attempts-ff9eb5b7a28e6143.yaml @@ -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.