1 From e4f179fa960ed18e8f45bc87d26552d720bc819b Mon Sep 17 00:00:00 2001
2 From: Volker Theile <vtheile@suse.com>
3 Date: Fri, 25 Sep 2020 13:17:19 +0200
4 Subject: [PATCH] mgr/dashboard: update pylint to 2.6.0
6 * Update pylint to 2.6.0.
9 Fixes: https://tracker.ceph.com/issues/47647
11 (cherry picked from commit 298c91958a41674a928d53f010b20f174f16d68f)
13 src/pybind/mgr/dashboard/.pylintrc | 8 ++++++--
14 .../mgr/dashboard/controllers/nfsganesha.py | 2 +-
15 src/pybind/mgr/dashboard/controllers/osd.py | 2 +-
16 src/pybind/mgr/dashboard/plugins/__init__.py | 2 +-
17 .../mgr/dashboard/requirements-lint.txt | 2 +-
18 src/pybind/mgr/dashboard/services/auth.py | 1 -
19 .../mgr/dashboard/services/ceph_service.py | 2 +-
20 src/pybind/mgr/dashboard/services/cephx.py | 2 +-
21 src/pybind/mgr/dashboard/services/ganesha.py | 20 +++++++++----------
22 .../mgr/dashboard/services/iscsi_client.py | 2 +-
23 .../mgr/dashboard/services/iscsi_config.py | 2 +-
24 src/pybind/mgr/dashboard/services/progress.py | 2 +-
25 .../mgr/dashboard/services/rgw_client.py | 3 ++-
26 src/pybind/mgr/dashboard/tests/__init__.py | 2 +-
27 src/pybind/mgr/dashboard/tests/helper.py | 2 +-
28 .../dashboard/tests/test_access_control.py | 2 +-
29 .../mgr/dashboard/tests/test_api_auditing.py | 2 +-
30 src/pybind/mgr/dashboard/tests/test_cephfs.py | 2 +-
31 .../mgr/dashboard/tests/test_controllers.py | 2 +-
32 src/pybind/mgr/dashboard/tests/test_docs.py | 2 +-
33 .../tests/test_erasure_code_profile.py | 2 +-
34 .../mgr/dashboard/tests/test_exceptions.py | 2 +-
35 .../dashboard/tests/test_feature_toggles.py | 2 +-
36 .../mgr/dashboard/tests/test_ganesha.py | 2 +-
37 .../mgr/dashboard/tests/test_grafana.py | 2 +-
38 src/pybind/mgr/dashboard/tests/test_home.py | 2 +-
39 src/pybind/mgr/dashboard/tests/test_host.py | 2 +-
40 src/pybind/mgr/dashboard/tests/test_iscsi.py | 3 ++-
41 .../mgr/dashboard/tests/test_orchestrator.py | 2 +-
42 src/pybind/mgr/dashboard/tests/test_osd.py | 4 ++--
43 .../mgr/dashboard/tests/test_plugin_debug.py | 2 +-
44 src/pybind/mgr/dashboard/tests/test_pool.py | 2 +-
45 .../mgr/dashboard/tests/test_prometheus.py | 2 +-
46 .../mgr/dashboard/tests/test_rbd_mirroring.py | 2 +-
47 .../mgr/dashboard/tests/test_rest_tasks.py | 2 +-
48 src/pybind/mgr/dashboard/tests/test_rgw.py | 2 +-
49 .../mgr/dashboard/tests/test_rgw_client.py | 2 +-
50 .../mgr/dashboard/tests/test_settings.py | 2 +-
51 src/pybind/mgr/dashboard/tests/test_sso.py | 3 ++-
52 src/pybind/mgr/dashboard/tests/test_tools.py | 2 +-
53 src/pybind/mgr/dashboard/tools.py | 2 +-
54 41 files changed, 58 insertions(+), 52 deletions(-)
56 diff --git a/src/pybind/mgr/dashboard/.pylintrc b/src/pybind/mgr/dashboard/.pylintrc
57 index 404a16a2e6..c4bf033cda 100644
58 --- a/src/pybind/mgr/dashboard/.pylintrc
59 +++ b/src/pybind/mgr/dashboard/.pylintrc
60 @@ -15,7 +15,7 @@ ignore-patterns=
62 # Python code to execute, usually for sys.path manipulation such as
65 +init-hook='import sys; sys.path.append("./")'
67 # Use multiple processes to speed up Pylint.
69 @@ -118,7 +118,11 @@ disable=import-star-module-level,
73 - useless-object-inheritance
74 + useless-object-inheritance,
75 + relative-beyond-top-level,
77 + super-with-arguments,
78 + import-outside-toplevel
81 # Enable the message, report, category or checker with the given id(s). You can
82 diff --git a/src/pybind/mgr/dashboard/controllers/nfsganesha.py b/src/pybind/mgr/dashboard/controllers/nfsganesha.py
83 index 1219f78b95..510b37a712 100644
84 --- a/src/pybind/mgr/dashboard/controllers/nfsganesha.py
85 +++ b/src/pybind/mgr/dashboard/controllers/nfsganesha.py
86 @@ -272,7 +272,7 @@ class NFSGaneshaService(RESTController):
87 class NFSGaneshaUi(BaseController):
88 @Endpoint('GET', '/cephx/clients')
89 def cephx_clients(self):
90 - return [client for client in CephX.list_clients()]
91 + return list(CephX.list_clients())
93 @Endpoint('GET', '/fsals')
95 diff --git a/src/pybind/mgr/dashboard/controllers/osd.py b/src/pybind/mgr/dashboard/controllers/osd.py
96 index 2731ad0ffc..f95951cba2 100644
97 --- a/src/pybind/mgr/dashboard/controllers/osd.py
98 +++ b/src/pybind/mgr/dashboard/controllers/osd.py
99 @@ -272,7 +272,7 @@ class Osd(RESTController):
102 @osd_task('create', {'tracking_id': '{tracking_id}'})
103 - def create(self, method, data, tracking_id): # pylint: disable=W0622
104 + def create(self, method, data, tracking_id): # pylint: disable=unused-argument
106 return self._create_bare(data)
107 if method == 'drive_groups':
108 diff --git a/src/pybind/mgr/dashboard/plugins/__init__.py b/src/pybind/mgr/dashboard/plugins/__init__.py
109 index 8973654770..3e3aca4001 100644
110 --- a/src/pybind/mgr/dashboard/plugins/__init__.py
111 +++ b/src/pybind/mgr/dashboard/plugins/__init__.py
112 @@ -71,4 +71,4 @@ class DashboardPluginManager(object):
113 PLUGIN_MANAGER = DashboardPluginManager("ceph-mgr.dashboard")
115 # Load all interfaces and their hooks
116 -from . import interfaces # noqa: F401 pylint: disable=wrong-import-position,cyclic-import
117 +from . import interfaces # noqa pylint: disable=C0413,W0406
118 diff --git a/src/pybind/mgr/dashboard/requirements-lint.txt b/src/pybind/mgr/dashboard/requirements-lint.txt
119 index 8f68ad3856..f01fa54e6e 100644
120 --- a/src/pybind/mgr/dashboard/requirements-lint.txt
121 +++ b/src/pybind/mgr/dashboard/requirements-lint.txt
123 -pylint==2.3.1; python_version >= '3'
125 flake8==3.7.8; python_version >= '3'
126 flake8-colors==0.1.6; python_version >= '3'
127 #TODO: Fix docstring issues: https://tracker.ceph.com/issues/41224
128 diff --git a/src/pybind/mgr/dashboard/services/auth.py b/src/pybind/mgr/dashboard/services/auth.py
129 index d829362e63..475d501263 100644
130 --- a/src/pybind/mgr/dashboard/services/auth.py
131 +++ b/src/pybind/mgr/dashboard/services/auth.py
132 @@ -177,7 +177,6 @@ class AuthManagerTool(cherrypy.Tool):
134 def _check_authorization(self, username):
135 self.logger.debug("checking authorization...")
136 - username = username
137 handler = cherrypy.request.handler.callable
138 controller = handler.__self__
139 sec_scope = getattr(controller, '_security_scope', None)
140 diff --git a/src/pybind/mgr/dashboard/services/ceph_service.py b/src/pybind/mgr/dashboard/services/ceph_service.py
141 index a6eee2957e..89582e3f73 100644
142 --- a/src/pybind/mgr/dashboard/services/ceph_service.py
143 +++ b/src/pybind/mgr/dashboard/services/ceph_service.py
144 @@ -12,7 +12,7 @@ from .. import mgr
145 from ..exceptions import DashboardException
148 - from typing import Dict, Any, Union # pylint: disable=unused-import
149 + from typing import Dict, Any, Union
151 pass # For typing only
153 diff --git a/src/pybind/mgr/dashboard/services/cephx.py b/src/pybind/mgr/dashboard/services/cephx.py
154 index ccda387961..60303ad85f 100644
155 --- a/src/pybind/mgr/dashboard/services/cephx.py
156 +++ b/src/pybind/mgr/dashboard/services/cephx.py
157 @@ -22,7 +22,7 @@ class CephX(object):
160 def list_clients(cls):
161 - return [client for client in cls._clients_map()]
162 + return list(cls._clients_map())
165 def get_client_key(cls, client_id):
166 diff --git a/src/pybind/mgr/dashboard/services/ganesha.py b/src/pybind/mgr/dashboard/services/ganesha.py
167 index e9144db406..764ebb3739 100644
168 --- a/src/pybind/mgr/dashboard/services/ganesha.py
169 +++ b/src/pybind/mgr/dashboard/services/ganesha.py
170 @@ -69,7 +69,7 @@ class Ganesha(object):
173 def get_ganesha_clusters(cls):
174 - return [cluster_id for cluster_id in cls._get_clusters_locations()]
175 + return list(cls._get_clusters_locations())
178 def _get_orch_nfs_instances():
179 @@ -325,7 +325,7 @@ class GaneshaConfParser(object):
180 for key, val in block.items():
181 if key == 'block_name':
183 - elif key == '_blocks_':
184 + if key == '_blocks_':
186 conf_str += GaneshaConfParser.write_block(blo, depth)
188 @@ -693,21 +693,21 @@ class Export(object):
189 result['attr_expiration_time'] = self.attr_expiration_time
190 result['security_label'] = self.security_label
191 if 'protocols' not in defaults:
192 - result['protocols'] = [p for p in self.protocols]
193 + result['protocols'] = list(self.protocols)
195 def_proto = defaults['protocols']
196 if not isinstance(def_proto, list):
197 def_proto = set([def_proto])
198 if self.protocols != def_proto:
199 - result['protocols'] = [p for p in self.protocols]
200 + result['protocols'] = list(self.protocols)
201 if 'transports' not in defaults:
202 - result['transports'] = [t for t in self.transports]
203 + result['transports'] = list(self.transports)
205 def_transp = defaults['transports']
206 if not isinstance(def_transp, list):
207 def_transp = set([def_transp])
208 if self.transports != def_transp:
209 - result['transports'] = [t for t in self.transports]
210 + result['transports'] = list(self.transports)
212 result['_blocks_'] = [self.fsal.to_fsal_block()]
213 result['_blocks_'].extend([client.to_client_block()
214 @@ -737,14 +737,14 @@ class Export(object):
216 'fsal': self.fsal.to_dict(),
217 'cluster_id': self.cluster_id,
218 - 'daemons': sorted([d for d in self.daemons]),
219 + 'daemons': sorted(list(self.daemons)),
220 'pseudo': self.pseudo,
222 'access_type': self.access_type,
223 'squash': self.squash,
224 'security_label': self.security_label,
225 - 'protocols': sorted([p for p in self.protocols]),
226 - 'transports': sorted([t for t in self.transports]),
227 + 'protocols': sorted(list(self.protocols)),
228 + 'transports': sorted(list(self.transports)),
229 'clients': [client.to_dict() for client in self.clients]
232 @@ -992,7 +992,7 @@ class GaneshaConf(object):
235 def list_daemons(self):
236 - return [daemon_id for daemon_id in self.daemons_conf_blocks]
237 + return list(self.daemons_conf_blocks)
239 def reload_daemons(self, daemons):
240 with mgr.rados.open_ioctx(self.rados_pool) as ioctx:
241 diff --git a/src/pybind/mgr/dashboard/services/iscsi_client.py b/src/pybind/mgr/dashboard/services/iscsi_client.py
242 index b82a51a3d4..c5a6dfa0e7 100644
243 --- a/src/pybind/mgr/dashboard/services/iscsi_client.py
244 +++ b/src/pybind/mgr/dashboard/services/iscsi_client.py
245 @@ -12,7 +12,7 @@ try:
247 from urllib.parse import urlparse
249 -from .iscsi_config import IscsiGatewaysConfig # pylint: disable=cyclic-import
250 +from .iscsi_config import IscsiGatewaysConfig
251 from ..settings import Settings
252 from ..rest_client import RestClient
254 diff --git a/src/pybind/mgr/dashboard/services/iscsi_config.py b/src/pybind/mgr/dashboard/services/iscsi_config.py
255 index ab90048500..86bdfc770d 100644
256 --- a/src/pybind/mgr/dashboard/services/iscsi_config.py
257 +++ b/src/pybind/mgr/dashboard/services/iscsi_config.py
258 @@ -57,7 +57,7 @@ class IscsiGatewaysConfig(object):
260 for gateway_name, gateway_config in config['gateways'].items():
261 if '.' not in gateway_name:
262 - from .iscsi_client import IscsiClient
263 + from .iscsi_client import IscsiClient # pylint: disable=cyclic-import
264 from ..rest_client import RequestException
266 service_url = gateway_config['service_url']
267 diff --git a/src/pybind/mgr/dashboard/services/progress.py b/src/pybind/mgr/dashboard/services/progress.py
268 index d8cf7521fa..d7b9ed973b 100644
269 --- a/src/pybind/mgr/dashboard/services/progress.py
270 +++ b/src/pybind/mgr/dashboard/services/progress.py
271 @@ -12,7 +12,7 @@ from __future__ import absolute_import
272 from datetime import datetime
276 +from . import rbd # pylint: disable=no-name-in-module
280 diff --git a/src/pybind/mgr/dashboard/services/rgw_client.py b/src/pybind/mgr/dashboard/services/rgw_client.py
281 index 5507eb6800..aee18acc54 100644
282 --- a/src/pybind/mgr/dashboard/services/rgw_client.py
283 +++ b/src/pybind/mgr/dashboard/services/rgw_client.py
284 @@ -16,7 +16,7 @@ from ..tools import build_url, dict_contains_path, json_str_to_object,\
288 - from typing import Dict, List, Optional # pylint: disable=unused-import
289 + from typing import Dict, List, Optional
291 pass # For typing only
293 @@ -303,6 +303,7 @@ class RgwClient(RestClient):
294 if self.userid != RgwClient._SYSTEM_USERID:
295 logger.info("Fetching new keys for user: %s", self.userid)
296 keys = RgwClient.admin_instance().get_user_keys(self.userid)
297 + # pylint: disable=attribute-defined-outside-init
298 self.auth = S3Auth(keys['access_key'], keys['secret_key'],
299 service_url=self.service_url)
301 diff --git a/src/pybind/mgr/dashboard/tests/__init__.py b/src/pybind/mgr/dashboard/tests/__init__.py
302 index 421378a155..8eb5bb8af1 100644
303 --- a/src/pybind/mgr/dashboard/tests/__init__.py
304 +++ b/src/pybind/mgr/dashboard/tests/__init__.py
305 @@ -21,7 +21,7 @@ from ..services.auth import AuthManagerTool
306 from ..services.exception import dashboard_exception_handler
308 from ..plugins import PLUGIN_MANAGER
309 -from ..plugins import feature_toggles, debug # noqa # pylint: disable=unused-import
310 +from ..plugins import feature_toggles, debug # noqa
313 PLUGIN_MANAGER.hook.init()
314 diff --git a/src/pybind/mgr/dashboard/tests/helper.py b/src/pybind/mgr/dashboard/tests/helper.py
315 index 9ec043d6be..06b83d42a8 100644
316 --- a/src/pybind/mgr/dashboard/tests/helper.py
317 +++ b/src/pybind/mgr/dashboard/tests/helper.py
319 from __future__ import absolute_import
322 - from typing import Dict, Any # pylint: disable=unused-import
323 + from typing import Dict, Any
327 diff --git a/src/pybind/mgr/dashboard/tests/test_access_control.py b/src/pybind/mgr/dashboard/tests/test_access_control.py
328 index 0039efc167..81604a161e 100644
329 --- a/src/pybind/mgr/dashboard/tests/test_access_control.py
330 +++ b/src/pybind/mgr/dashboard/tests/test_access_control.py
331 @@ -9,7 +9,7 @@ import unittest
333 from datetime import datetime, timedelta
335 -from . import CmdException, CLICommandTestMixin
336 +from . import CmdException, CLICommandTestMixin # pylint: disable=no-name-in-module
338 from ..security import Scope, Permission
339 from ..services.access_control import load_access_control_db, \
340 diff --git a/src/pybind/mgr/dashboard/tests/test_api_auditing.py b/src/pybind/mgr/dashboard/tests/test_api_auditing.py
341 index 0416c03638..023ea7992a 100644
342 --- a/src/pybind/mgr/dashboard/tests/test_api_auditing.py
343 +++ b/src/pybind/mgr/dashboard/tests/test_api_auditing.py
346 import unittest.mock as mock
348 -from . import ControllerTestCase, KVStoreMockMixin
349 +from . import ControllerTestCase, KVStoreMockMixin # pylint: disable=no-name-in-module
350 from ..controllers import RESTController, Controller
351 from ..tools import RequestLoggingTool
353 diff --git a/src/pybind/mgr/dashboard/tests/test_cephfs.py b/src/pybind/mgr/dashboard/tests/test_cephfs.py
354 index e9abda5380..778b0aa275 100644
355 --- a/src/pybind/mgr/dashboard/tests/test_cephfs.py
356 +++ b/src/pybind/mgr/dashboard/tests/test_cephfs.py
357 @@ -6,7 +6,7 @@ except ImportError:
358 from unittest.mock import Mock
361 -from . import ControllerTestCase
362 +from . import ControllerTestCase # pylint: disable=no-name-in-module
363 from ..controllers.cephfs import CephFS
366 diff --git a/src/pybind/mgr/dashboard/tests/test_controllers.py b/src/pybind/mgr/dashboard/tests/test_controllers.py
367 index 0e88047061..b14878ff2e 100644
368 --- a/src/pybind/mgr/dashboard/tests/test_controllers.py
369 +++ b/src/pybind/mgr/dashboard/tests/test_controllers.py
371 # -*- coding: utf-8 -*-
372 from __future__ import absolute_import
374 -from . import ControllerTestCase
375 +from . import ControllerTestCase # pylint: disable=no-name-in-module
376 from ..controllers import BaseController, RESTController, Controller, \
377 ApiController, Endpoint
379 diff --git a/src/pybind/mgr/dashboard/tests/test_docs.py b/src/pybind/mgr/dashboard/tests/test_docs.py
380 index a6e03b5267..ccb777aca5 100644
381 --- a/src/pybind/mgr/dashboard/tests/test_docs.py
382 +++ b/src/pybind/mgr/dashboard/tests/test_docs.py
384 # # -*- coding: utf-8 -*-
385 from __future__ import absolute_import
387 -from . import ControllerTestCase
388 +from . import ControllerTestCase # pylint: disable=no-name-in-module
389 from ..controllers import RESTController, ApiController, Endpoint, EndpointDoc, ControllerDoc
390 from ..controllers.docs import Docs
392 diff --git a/src/pybind/mgr/dashboard/tests/test_erasure_code_profile.py b/src/pybind/mgr/dashboard/tests/test_erasure_code_profile.py
393 index 557b7c1061..d266735e8f 100644
394 --- a/src/pybind/mgr/dashboard/tests/test_erasure_code_profile.py
395 +++ b/src/pybind/mgr/dashboard/tests/test_erasure_code_profile.py
397 # -*- coding: utf-8 -*-
400 -from . import ControllerTestCase
401 +from . import ControllerTestCase # pylint: disable=no-name-in-module
402 from ..controllers.erasure_code_profile import ErasureCodeProfile
405 diff --git a/src/pybind/mgr/dashboard/tests/test_exceptions.py b/src/pybind/mgr/dashboard/tests/test_exceptions.py
406 index 2bb25da1bf..b42c356479 100644
407 --- a/src/pybind/mgr/dashboard/tests/test_exceptions.py
408 +++ b/src/pybind/mgr/dashboard/tests/test_exceptions.py
409 @@ -5,7 +5,7 @@ import time
413 -from . import ControllerTestCase
414 +from . import ControllerTestCase # pylint: disable=no-name-in-module
415 from ..services.ceph_service import SendCommandError
416 from ..controllers import RESTController, Controller, Task, Endpoint
417 from ..services.exception import handle_rados_error, handle_send_command_error, \
418 diff --git a/src/pybind/mgr/dashboard/tests/test_feature_toggles.py b/src/pybind/mgr/dashboard/tests/test_feature_toggles.py
419 index 031d0ef839..23068c5eda 100644
420 --- a/src/pybind/mgr/dashboard/tests/test_feature_toggles.py
421 +++ b/src/pybind/mgr/dashboard/tests/test_feature_toggles.py
424 from unittest.mock import Mock, patch
426 -from . import KVStoreMockMixin
427 +from . import KVStoreMockMixin # pylint: disable=no-name-in-module
428 from ..plugins.feature_toggles import FeatureToggles, Features
431 diff --git a/src/pybind/mgr/dashboard/tests/test_ganesha.py b/src/pybind/mgr/dashboard/tests/test_ganesha.py
432 index 03f1f5b551..44498ac40c 100644
433 --- a/src/pybind/mgr/dashboard/tests/test_ganesha.py
434 +++ b/src/pybind/mgr/dashboard/tests/test_ganesha.py
435 @@ -9,7 +9,7 @@ except ImportError:
436 from unittest.mock import MagicMock, Mock
439 -from . import KVStoreMockMixin
440 +from . import KVStoreMockMixin # pylint: disable=no-name-in-module
442 from ..settings import Settings
443 from ..services import ganesha
444 diff --git a/src/pybind/mgr/dashboard/tests/test_grafana.py b/src/pybind/mgr/dashboard/tests/test_grafana.py
445 index 0eb46bf0f0..a5456905f2 100644
446 --- a/src/pybind/mgr/dashboard/tests/test_grafana.py
447 +++ b/src/pybind/mgr/dashboard/tests/test_grafana.py
448 @@ -8,7 +8,7 @@ except ImportError:
450 from requests import RequestException
452 -from . import ControllerTestCase, KVStoreMockMixin
453 +from . import ControllerTestCase, KVStoreMockMixin # pylint: disable=no-name-in-module
454 from ..controllers.grafana import Grafana
455 from ..grafana import GrafanaRestClient
456 from ..settings import Settings
457 diff --git a/src/pybind/mgr/dashboard/tests/test_home.py b/src/pybind/mgr/dashboard/tests/test_home.py
458 index c3088b7a65..c942eed9be 100644
459 --- a/src/pybind/mgr/dashboard/tests/test_home.py
460 +++ b/src/pybind/mgr/dashboard/tests/test_home.py
463 import unittest.mock as mock
465 -from . import ControllerTestCase, FakeFsMixin
466 +from . import ControllerTestCase, FakeFsMixin # pylint: disable=no-name-in-module
469 from ..controllers.home import HomeController, LanguageMixin
470 diff --git a/src/pybind/mgr/dashboard/tests/test_host.py b/src/pybind/mgr/dashboard/tests/test_host.py
471 index ab7286074b..191c3f1245 100644
472 --- a/src/pybind/mgr/dashboard/tests/test_host.py
473 +++ b/src/pybind/mgr/dashboard/tests/test_host.py
474 @@ -7,7 +7,7 @@ except ImportError:
476 from orchestrator import HostSpec
478 -from . import ControllerTestCase
479 +from . import ControllerTestCase # pylint: disable=no-name-in-module
480 from ..controllers.host import get_hosts, Host, HostUi
483 diff --git a/src/pybind/mgr/dashboard/tests/test_iscsi.py b/src/pybind/mgr/dashboard/tests/test_iscsi.py
484 index 962ffeb684..72d64453ac 100644
485 --- a/src/pybind/mgr/dashboard/tests/test_iscsi.py
486 +++ b/src/pybind/mgr/dashboard/tests/test_iscsi.py
487 @@ -10,7 +10,8 @@ try:
489 import unittest.mock as mock
491 -from . import CmdException, ControllerTestCase, CLICommandTestMixin, KVStoreMockMixin
492 +from . import CmdException, ControllerTestCase, CLICommandTestMixin, \
493 + KVStoreMockMixin # pylint: disable=no-name-in-module
495 from ..controllers.iscsi import Iscsi, IscsiTarget
496 from ..services.iscsi_client import IscsiClient
497 diff --git a/src/pybind/mgr/dashboard/tests/test_orchestrator.py b/src/pybind/mgr/dashboard/tests/test_orchestrator.py
498 index 714d59c085..9a9d179bbc 100644
499 --- a/src/pybind/mgr/dashboard/tests/test_orchestrator.py
500 +++ b/src/pybind/mgr/dashboard/tests/test_orchestrator.py
501 @@ -6,7 +6,7 @@ except ImportError:
503 from orchestrator import InventoryHost
505 -from . import ControllerTestCase
506 +from . import ControllerTestCase # pylint: disable=no-name-in-module
508 from ..controllers.orchestrator import get_device_osd_map
509 from ..controllers.orchestrator import Orchestrator
510 diff --git a/src/pybind/mgr/dashboard/tests/test_osd.py b/src/pybind/mgr/dashboard/tests/test_osd.py
511 index aeb32ed576..063705ddbb 100644
512 --- a/src/pybind/mgr/dashboard/tests/test_osd.py
513 +++ b/src/pybind/mgr/dashboard/tests/test_osd.py
514 @@ -11,11 +11,11 @@ except ImportError:
515 from ceph.deployment.drive_group import DeviceSelection, DriveGroupSpec
516 from ceph.deployment.service_spec import PlacementSpec
518 -from . import ControllerTestCase
519 +from . import ControllerTestCase # pylint: disable=no-name-in-module
520 from ..controllers.osd import Osd
521 from ..tools import NotificationQueue, TaskManager
523 -from .helper import update_dict
524 +from .helper import update_dict # pylint: disable=import-error
527 from typing import List, Dict, Any # pylint: disable=unused-import
528 diff --git a/src/pybind/mgr/dashboard/tests/test_plugin_debug.py b/src/pybind/mgr/dashboard/tests/test_plugin_debug.py
529 index 4985540046..cb4d1afc21 100644
530 --- a/src/pybind/mgr/dashboard/tests/test_plugin_debug.py
531 +++ b/src/pybind/mgr/dashboard/tests/test_plugin_debug.py
533 # -*- coding: utf-8 -*-
534 from __future__ import absolute_import
536 -from . import CLICommandTestMixin, ControllerTestCase
537 +from . import CLICommandTestMixin, ControllerTestCase # pylint: disable=no-name-in-module
540 class TestPluginDebug(ControllerTestCase, CLICommandTestMixin):
541 diff --git a/src/pybind/mgr/dashboard/tests/test_pool.py b/src/pybind/mgr/dashboard/tests/test_pool.py
542 index e33e436540..179a8feeed 100644
543 --- a/src/pybind/mgr/dashboard/tests/test_pool.py
544 +++ b/src/pybind/mgr/dashboard/tests/test_pool.py
547 import unittest.mock as mock
549 -from . import ControllerTestCase
550 +from . import ControllerTestCase # pylint: disable=no-name-in-module
551 from ..controllers.pool import Pool
552 from ..controllers.task import Task
553 from ..tools import NotificationQueue, TaskManager
554 diff --git a/src/pybind/mgr/dashboard/tests/test_prometheus.py b/src/pybind/mgr/dashboard/tests/test_prometheus.py
555 index 3385d66a97..ef669a6203 100644
556 --- a/src/pybind/mgr/dashboard/tests/test_prometheus.py
557 +++ b/src/pybind/mgr/dashboard/tests/test_prometheus.py
560 from unittest.mock import patch
562 -from . import ControllerTestCase
563 +from . import ControllerTestCase # pylint: disable=no-name-in-module
565 from ..controllers.prometheus import Prometheus, PrometheusReceiver, PrometheusNotifications
567 diff --git a/src/pybind/mgr/dashboard/tests/test_rbd_mirroring.py b/src/pybind/mgr/dashboard/tests/test_rbd_mirroring.py
568 index ecb4856dc1..d7e0c7dd1e 100644
569 --- a/src/pybind/mgr/dashboard/tests/test_rbd_mirroring.py
570 +++ b/src/pybind/mgr/dashboard/tests/test_rbd_mirroring.py
573 import unittest.mock as mock
575 -from . import ControllerTestCase
576 +from . import ControllerTestCase # pylint: disable=no-name-in-module
578 from ..controllers.summary import Summary
579 from ..controllers.rbd_mirroring import RbdMirroring, RbdMirroringSummary, \
580 diff --git a/src/pybind/mgr/dashboard/tests/test_rest_tasks.py b/src/pybind/mgr/dashboard/tests/test_rest_tasks.py
581 index e9d7907f05..aa158cd288 100644
582 --- a/src/pybind/mgr/dashboard/tests/test_rest_tasks.py
583 +++ b/src/pybind/mgr/dashboard/tests/test_rest_tasks.py
586 import unittest.mock as mock
588 -from . import ControllerTestCase
589 +from . import ControllerTestCase # pylint: disable=no-name-in-module
590 from ..controllers import Controller, RESTController, Task
591 from ..controllers.task import Task as TaskController
592 from ..services import progress
593 diff --git a/src/pybind/mgr/dashboard/tests/test_rgw.py b/src/pybind/mgr/dashboard/tests/test_rgw.py
594 index 2c90e7d11b..11818ca2b7 100644
595 --- a/src/pybind/mgr/dashboard/tests/test_rgw.py
596 +++ b/src/pybind/mgr/dashboard/tests/test_rgw.py
599 import unittest.mock as mock
601 -from . import ControllerTestCase
602 +from . import ControllerTestCase # pylint: disable=no-name-in-module
603 from ..controllers.rgw import RgwUser
606 diff --git a/src/pybind/mgr/dashboard/tests/test_rgw_client.py b/src/pybind/mgr/dashboard/tests/test_rgw_client.py
607 index d69ab2f48d..fa711b45ca 100644
608 --- a/src/pybind/mgr/dashboard/tests/test_rgw_client.py
609 +++ b/src/pybind/mgr/dashboard/tests/test_rgw_client.py
610 @@ -9,7 +9,7 @@ except ImportError:
612 from ..services.rgw_client import RgwClient, _parse_frontend_config
613 from ..settings import Settings
614 -from . import KVStoreMockMixin
615 +from . import KVStoreMockMixin # pylint: disable=no-name-in-module
618 class RgwClientTest(unittest.TestCase, KVStoreMockMixin):
619 diff --git a/src/pybind/mgr/dashboard/tests/test_settings.py b/src/pybind/mgr/dashboard/tests/test_settings.py
620 index da54a20655..abdb059c1d 100644
621 --- a/src/pybind/mgr/dashboard/tests/test_settings.py
622 +++ b/src/pybind/mgr/dashboard/tests/test_settings.py
623 @@ -3,7 +3,7 @@ from __future__ import absolute_import
627 -from . import KVStoreMockMixin, ControllerTestCase
628 +from . import KVStoreMockMixin, ControllerTestCase # pylint: disable=no-name-in-module
629 from .. import settings
630 from ..controllers.settings import Settings as SettingsController
631 from ..settings import Settings, handle_option_command
632 diff --git a/src/pybind/mgr/dashboard/tests/test_sso.py b/src/pybind/mgr/dashboard/tests/test_sso.py
633 index f8681b89ed..e8141a09cc 100644
634 --- a/src/pybind/mgr/dashboard/tests/test_sso.py
635 +++ b/src/pybind/mgr/dashboard/tests/test_sso.py
636 @@ -5,7 +5,8 @@ from __future__ import absolute_import
640 -from . import CmdException, exec_dashboard_cmd, KVStoreMockMixin
641 +from . import CmdException, exec_dashboard_cmd, \
642 + KVStoreMockMixin # pylint: disable=no-name-in-module
643 from ..services.sso import handle_sso_command, load_sso_db
646 diff --git a/src/pybind/mgr/dashboard/tests/test_tools.py b/src/pybind/mgr/dashboard/tests/test_tools.py
647 index 0f27ec8e63..340ff8c41d 100644
648 --- a/src/pybind/mgr/dashboard/tests/test_tools.py
649 +++ b/src/pybind/mgr/dashboard/tests/test_tools.py
650 @@ -10,7 +10,7 @@ try:
652 from unittest.mock import patch
654 -from . import ControllerTestCase
655 +from . import ControllerTestCase # pylint: disable=no-name-in-module
656 from ..services.exception import handle_rados_error
657 from ..controllers import RESTController, ApiController, Controller, \
658 BaseController, Proxy
659 diff --git a/src/pybind/mgr/dashboard/tools.py b/src/pybind/mgr/dashboard/tools.py
660 index 2b6d92ca55..d9a2d813c0 100644
661 --- a/src/pybind/mgr/dashboard/tools.py
662 +++ b/src/pybind/mgr/dashboard/tools.py
663 @@ -30,7 +30,7 @@ from .services.auth import JwtManager
666 from typing import Any, AnyStr, Callable, DefaultDict, Deque,\
667 - Dict, List, Set, Tuple, Union # noqa pylint: disable=unused-import
668 + Dict, List, Set, Tuple, Union # noqa
670 pass # For typing only