Fix flake8 warnings on flake8-import-order>0.19.0

This patch addresses the issues related to the new TYPE_CHECKING
style check "I300" introduced in flake8-import-order version 0.19.0
and later.

Change-Id: I3a442308e031e0c206c82d34ee4516ac6cc21656
This commit is contained in:
Fernando Ferraz
2025-06-23 19:32:17 -03:00
parent 4b96a9a88e
commit 781668f445
4 changed files with 10 additions and 9 deletions

View File

@@ -23,12 +23,12 @@ from oslo_utils import strutils
import webob
from webob import exc
if typing.TYPE_CHECKING:
# conditional import to avoid a circular import problem from cinderlib
from cinder import context
from cinder import exception
from cinder.i18n import _
if typing.TYPE_CHECKING:
from cinder import context
CONF = cfg.CONF
CONF.import_group('keystone_authtoken',
'keystonemiddleware.auth_token.__init__')

View File

@@ -28,11 +28,11 @@ import webob
from cinder.api import api_utils
from cinder.api import microversions as mv
from cinder.common import constants
if typing.TYPE_CHECKING:
from cinder import context
from cinder import exception
from cinder.i18n import _
if typing.TYPE_CHECKING:
from cinder import context
api_common_opts = [
cfg.IntOpt('osapi_max_limit',

View File

@@ -44,8 +44,6 @@ from oslo_log import log as logging
from oslo_privsep import priv_context
from oslo_reports import guru_meditation_report as gmr
from oslo_reports import opts as gmr_opts
if typing.TYPE_CHECKING:
import oslo_service
# Need to register global_opts
from cinder.common import config # noqa
@@ -57,6 +55,8 @@ from cinder import service
from cinder import utils
from cinder import version
if typing.TYPE_CHECKING:
import oslo_service
CONF = cfg.CONF

View File

@@ -48,8 +48,6 @@ from oslo_log import log as logging
from oslo_privsep import priv_context
from oslo_reports import guru_meditation_report as gmr
from oslo_reports import opts as gmr_opts
if typing.TYPE_CHECKING:
import oslo_service
# Need to register global_opts
from cinder.common import config # noqa
@@ -64,6 +62,9 @@ from cinder import service
from cinder import utils
from cinder import version
if typing.TYPE_CHECKING:
import oslo_service
CONF = cfg.CONF
host_opt = cfg.StrOpt('backend_host', help='Backend override of host value.')