diff --git a/ironic/conf/iscsi.py b/ironic/conf/iscsi.py index 0ac340012b..8b1a258e0a 100644 --- a/ironic/conf/iscsi.py +++ b/ironic/conf/iscsi.py @@ -28,14 +28,12 @@ opts = [ 'to control the conversion of the original file ' 'when copying to the host. It can contain several ' 'options separated by commas.')), - # TODO(dtantsur): update in Ussuri when the deprecated option is removed - # from ironic-lib. cfg.IntOpt('verify_attempts', + default=3, min=1, help=_('Maximum attempts to verify an iSCSI connection is ' 'active, sleeping 1 second between attempts. Defaults ' - 'to the deprecated [disk_utils]iscsi_verify_attempts ' - 'option, after its removal will default to 3.')), + 'to 3.')), ] diff --git a/ironic/drivers/modules/deploy_utils.py b/ironic/drivers/modules/deploy_utils.py index f8c9728539..2176e0fbb9 100644 --- a/ironic/drivers/modules/deploy_utils.py +++ b/ironic/drivers/modules/deploy_utils.py @@ -87,15 +87,6 @@ def _get_ironic_session(): return _IRONIC_SESSION -# TODO(dtantsur): just use CONF.iscsi.verify_attempts when -# iscsi_verify_attempts is removed from ironic-lib. -def _iscsi_verify_attempts(): - # Be prepared for eventual removal, hardcode the default of 3 - return (getattr(CONF.disk_utils, 'iscsi_verify_attempts', 3) - if CONF.iscsi.verify_attempts is None - else CONF.iscsi.verify_attempts) - - def _wrap_ipv6(ip): if netutils.is_valid_ipv6(ip): return "[%s]" % ip @@ -193,7 +184,7 @@ def check_file_system_for_iscsi_device(portal_address, check_dir = "/dev/disk/by-path/ip-%s:%s-iscsi-%s-lun-1" % (portal_address, portal_port, target_iqn) - total_checks = _iscsi_verify_attempts() + total_checks = CONF.iscsi.verify_attempts for attempt in range(total_checks): if os.path.exists(check_dir): break @@ -217,7 +208,7 @@ def verify_iscsi_connection(target_iqn): """Verify iscsi connection.""" LOG.debug("Checking for iSCSI target to become active.") - total_checks = _iscsi_verify_attempts() + total_checks = CONF.iscsi.verify_attempts for attempt in range(total_checks): out, _err = utils.execute('iscsiadm', '-m', 'node', diff --git a/releasenotes/notes/remove-iscsi-verify-attempts-ede5b56b0545da08.yaml b/releasenotes/notes/remove-iscsi-verify-attempts-ede5b56b0545da08.yaml new file mode 100644 index 0000000000..ecf9f546dd --- /dev/null +++ b/releasenotes/notes/remove-iscsi-verify-attempts-ede5b56b0545da08.yaml @@ -0,0 +1,6 @@ +--- +upgrade: + - | + The configuration option ``[disk_utils]iscsi_verify_attempts`` + was deprecated in Train and it's now removed from ironic-lib. + Please use the ``[iscsi]verify_attempts`` option instead.