[arch-commits] Commit in ceph/trunk (3 files)

Evangelos Foutras foutrelis at archlinux.org
Thu Nov 26 03:52:25 UTC 2020


    Date: Thursday, November 26, 2020 @ 03:52:24
  Author: foutrelis
Revision: 761400

Fix tests for Python 3.9; add CTEST_OUTPUT_ON_FAILURE=1

Added:
  ceph/trunk/mgr-dashboard-update-pylint-to-2.6.0.patch
  ceph/trunk/qa-src-update-mypy-to-0.782.patch
Modified:
  ceph/trunk/PKGBUILD

--------------------------------------------+
 PKGBUILD                                   |   18 
 mgr-dashboard-update-pylint-to-2.6.0.patch |  671 +++++++++++++++++++++++++++
 qa-src-update-mypy-to-0.782.patch          |   65 ++
 3 files changed, 752 insertions(+), 2 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2020-11-26 03:51:19 UTC (rev 761399)
+++ PKGBUILD	2020-11-26 03:52:24 UTC (rev 761400)
@@ -54,6 +54,8 @@
   'ceph-15.2.4-system-uring.patch'
   'ceph-15.2.5-missing-includes.patch'
   'disable-empty-readable.sh-test.patch'
+  'qa-src-update-mypy-to-0.782.patch'
+  'mgr-dashboard-update-pylint-to-2.6.0.patch'
 )
 sha512sums=('0bbbbc532fb9f29437c094a86a1e58040f03b679e4d52ea9cc752ecf411c594c8ec37dc5e9f0ee47712d32b93b4e60b0f3fded280867d41c41b8db806b375e4e'
             '4354001c1abd9a0c385ba7bd529e3638fb6660b6a88d4e49706d4ac21c81b8e829303a20fb5445730bdac18c4865efb10bc809c1cd56d743c12aa9a52e160049'
@@ -68,7 +70,9 @@
             '20256de5c3227caa149f8285bcc90fcbd67be8cefa568fb72ad0d43688f1f62db7c7fc231dfd4ecf2dd11be68bf1ccc284ebbc691a82a26f3968200f12c82097'
             '8258661e56b5360f4260fdd29b07bac4d415068a112b61ca8c55c529fb1593d8d61a0d59a4eec8f1567b97167c058082198d008f55f8ee701cb46489df5f7823'
             '84de66f64ea96cd59b40dfb5b8c5d093fe49df1139b45ad9d1bd6b9ebd2f1200b6e931adcf032639a4995af322cf05c1ef9050eb1cb6673e29e040d4e348b3d5'
-            '2234d005df71b3b6013e6b76ad07a5791e3af7efec5f41c78eb1a9c92a22a67f0be9560be59b52534e90bfe251bcf32c33d5d40163f3f8f7e7420691f0f4a222')
+            '2234d005df71b3b6013e6b76ad07a5791e3af7efec5f41c78eb1a9c92a22a67f0be9560be59b52534e90bfe251bcf32c33d5d40163f3f8f7e7420691f0f4a222'
+            '204741c65b8ceeddae0a58a49e2b4249ee7ffc624ce8d9faa6284af198abe63bffb6758e064eeff6d1857be044647f99749a45443e258b35e92cc36b9edeba80'
+            'f65a028832a7d8ec6db55b4399c4448f0f7182031d81c239e3d7a04d2d27394481af2e4313bcff54c775934389773658b0bb0574107677f377e581bd51876d59')
 
 
 # -fno-plt causes linker errors (undefined reference to internal methods)
@@ -92,6 +96,15 @@
     fi
   done
 
+  # temporarily disable unsubscriptable-object (buggy on Python 3.9)
+  # https://github.com/PyCQA/pylint/issues/3882
+  sed -i '/^disable=/a\        unsubscriptable-object,' \
+    src/pybind/mgr/dashboard/.pylintrc
+
+  # mypy complains about this but the exception is handled; not sure what's up
+  sed -i 's/from base64 import encodestring$/&  # type: ignore/' \
+    src/pybind/mgr/dashboard/awsauth.py
+
   # suppress deprecation warnings
   sed -i '/#ifndef CEPH_CONFIG_H/i#define BOOST_ALLOW_DEPRECATED_HEADERS' \
     src/common/config.h
@@ -177,7 +190,8 @@
 check() {
   cd "${srcdir}/${pkgbase}-${pkgver}"
 
-  export CTEST_PARALLEL_LEVEL="8"
+  export CTEST_PARALLEL_LEVEL=8
+  export CTEST_OUTPUT_ON_FAILURE=1
   VERBOSE=1 make -C build check
 
   # sometimes processes are not properly terminated...

Added: mgr-dashboard-update-pylint-to-2.6.0.patch
===================================================================
--- mgr-dashboard-update-pylint-to-2.6.0.patch	                        (rev 0)
+++ mgr-dashboard-update-pylint-to-2.6.0.patch	2020-11-26 03:52:24 UTC (rev 761400)
@@ -0,0 +1,671 @@
+From e4f179fa960ed18e8f45bc87d26552d720bc819b Mon Sep 17 00:00:00 2001
+From: Volker Theile <vtheile at suse.com>
+Date: Fri, 25 Sep 2020 13:17:19 +0200
+Subject: [PATCH] mgr/dashboard: update pylint to 2.6.0
+
+* Update pylint to 2.6.0.
+* Fix pylint issues.
+
+Fixes: https://tracker.ceph.com/issues/47647
+
+(cherry picked from commit 298c91958a41674a928d53f010b20f174f16d68f)
+---
+ src/pybind/mgr/dashboard/.pylintrc            |  8 ++++++--
+ .../mgr/dashboard/controllers/nfsganesha.py   |  2 +-
+ src/pybind/mgr/dashboard/controllers/osd.py   |  2 +-
+ src/pybind/mgr/dashboard/plugins/__init__.py  |  2 +-
+ .../mgr/dashboard/requirements-lint.txt       |  2 +-
+ src/pybind/mgr/dashboard/services/auth.py     |  1 -
+ .../mgr/dashboard/services/ceph_service.py    |  2 +-
+ src/pybind/mgr/dashboard/services/cephx.py    |  2 +-
+ src/pybind/mgr/dashboard/services/ganesha.py  | 20 +++++++++----------
+ .../mgr/dashboard/services/iscsi_client.py    |  2 +-
+ .../mgr/dashboard/services/iscsi_config.py    |  2 +-
+ src/pybind/mgr/dashboard/services/progress.py |  2 +-
+ .../mgr/dashboard/services/rgw_client.py      |  3 ++-
+ src/pybind/mgr/dashboard/tests/__init__.py    |  2 +-
+ src/pybind/mgr/dashboard/tests/helper.py      |  2 +-
+ .../dashboard/tests/test_access_control.py    |  2 +-
+ .../mgr/dashboard/tests/test_api_auditing.py  |  2 +-
+ src/pybind/mgr/dashboard/tests/test_cephfs.py |  2 +-
+ .../mgr/dashboard/tests/test_controllers.py   |  2 +-
+ src/pybind/mgr/dashboard/tests/test_docs.py   |  2 +-
+ .../tests/test_erasure_code_profile.py        |  2 +-
+ .../mgr/dashboard/tests/test_exceptions.py    |  2 +-
+ .../dashboard/tests/test_feature_toggles.py   |  2 +-
+ .../mgr/dashboard/tests/test_ganesha.py       |  2 +-
+ .../mgr/dashboard/tests/test_grafana.py       |  2 +-
+ src/pybind/mgr/dashboard/tests/test_home.py   |  2 +-
+ src/pybind/mgr/dashboard/tests/test_host.py   |  2 +-
+ src/pybind/mgr/dashboard/tests/test_iscsi.py  |  3 ++-
+ .../mgr/dashboard/tests/test_orchestrator.py  |  2 +-
+ src/pybind/mgr/dashboard/tests/test_osd.py    |  4 ++--
+ .../mgr/dashboard/tests/test_plugin_debug.py  |  2 +-
+ src/pybind/mgr/dashboard/tests/test_pool.py   |  2 +-
+ .../mgr/dashboard/tests/test_prometheus.py    |  2 +-
+ .../mgr/dashboard/tests/test_rbd_mirroring.py |  2 +-
+ .../mgr/dashboard/tests/test_rest_tasks.py    |  2 +-
+ src/pybind/mgr/dashboard/tests/test_rgw.py    |  2 +-
+ .../mgr/dashboard/tests/test_rgw_client.py    |  2 +-
+ .../mgr/dashboard/tests/test_settings.py      |  2 +-
+ src/pybind/mgr/dashboard/tests/test_sso.py    |  3 ++-
+ src/pybind/mgr/dashboard/tests/test_tools.py  |  2 +-
+ src/pybind/mgr/dashboard/tools.py             |  2 +-
+ 41 files changed, 58 insertions(+), 52 deletions(-)
+
+diff --git a/src/pybind/mgr/dashboard/.pylintrc b/src/pybind/mgr/dashboard/.pylintrc
+index 404a16a2e6..c4bf033cda 100644
+--- a/src/pybind/mgr/dashboard/.pylintrc
++++ b/src/pybind/mgr/dashboard/.pylintrc
+@@ -15,7 +15,7 @@ ignore-patterns=
+ 
+ # Python code to execute, usually for sys.path manipulation such as
+ # pygtk.require().
+-#init-hook=
++init-hook='import sys; sys.path.append("./")'
+ 
+ # Use multiple processes to speed up Pylint.
+ jobs=1
+@@ -118,7 +118,11 @@ disable=import-star-module-level,
+         too-many-arguments,
+         too-many-locals,
+         too-many-statements,
+-        useless-object-inheritance
++        useless-object-inheritance,
++        relative-beyond-top-level,
++        raise-missing-from,
++        super-with-arguments,
++        import-outside-toplevel
+ 
+ 
+ # Enable the message, report, category or checker with the given id(s). You can
+diff --git a/src/pybind/mgr/dashboard/controllers/nfsganesha.py b/src/pybind/mgr/dashboard/controllers/nfsganesha.py
+index 1219f78b95..510b37a712 100644
+--- a/src/pybind/mgr/dashboard/controllers/nfsganesha.py
++++ b/src/pybind/mgr/dashboard/controllers/nfsganesha.py
+@@ -272,7 +272,7 @@ class NFSGaneshaService(RESTController):
+ class NFSGaneshaUi(BaseController):
+     @Endpoint('GET', '/cephx/clients')
+     def cephx_clients(self):
+-        return [client for client in CephX.list_clients()]
++        return list(CephX.list_clients())
+ 
+     @Endpoint('GET', '/fsals')
+     def fsals(self):
+diff --git a/src/pybind/mgr/dashboard/controllers/osd.py b/src/pybind/mgr/dashboard/controllers/osd.py
+index 2731ad0ffc..f95951cba2 100644
+--- a/src/pybind/mgr/dashboard/controllers/osd.py
++++ b/src/pybind/mgr/dashboard/controllers/osd.py
+@@ -272,7 +272,7 @@ class Osd(RESTController):
+ 
+     @CreatePermission
+     @osd_task('create', {'tracking_id': '{tracking_id}'})
+-    def create(self, method, data, tracking_id):  # pylint: disable=W0622
++    def create(self, method, data, tracking_id):  # pylint: disable=unused-argument
+         if method == 'bare':
+             return self._create_bare(data)
+         if method == 'drive_groups':
+diff --git a/src/pybind/mgr/dashboard/plugins/__init__.py b/src/pybind/mgr/dashboard/plugins/__init__.py
+index 8973654770..3e3aca4001 100644
+--- a/src/pybind/mgr/dashboard/plugins/__init__.py
++++ b/src/pybind/mgr/dashboard/plugins/__init__.py
+@@ -71,4 +71,4 @@ class DashboardPluginManager(object):
+ PLUGIN_MANAGER = DashboardPluginManager("ceph-mgr.dashboard")
+ 
+ # Load all interfaces and their hooks
+-from . import interfaces  # noqa: F401 pylint: disable=wrong-import-position,cyclic-import
++from . import interfaces  # noqa pylint: disable=C0413,W0406
+diff --git a/src/pybind/mgr/dashboard/requirements-lint.txt b/src/pybind/mgr/dashboard/requirements-lint.txt
+index 8f68ad3856..f01fa54e6e 100644
+--- a/src/pybind/mgr/dashboard/requirements-lint.txt
++++ b/src/pybind/mgr/dashboard/requirements-lint.txt
+@@ -1,4 +1,4 @@
+-pylint==2.3.1; python_version >= '3'
++pylint==2.6.0
+ flake8==3.7.8; python_version >= '3'
+ flake8-colors==0.1.6; python_version >= '3'
+ #TODO: Fix docstring issues: https://tracker.ceph.com/issues/41224
+diff --git a/src/pybind/mgr/dashboard/services/auth.py b/src/pybind/mgr/dashboard/services/auth.py
+index d829362e63..475d501263 100644
+--- a/src/pybind/mgr/dashboard/services/auth.py
++++ b/src/pybind/mgr/dashboard/services/auth.py
+@@ -177,7 +177,6 @@ class AuthManagerTool(cherrypy.Tool):
+ 
+     def _check_authorization(self, username):
+         self.logger.debug("checking authorization...")
+-        username = username
+         handler = cherrypy.request.handler.callable
+         controller = handler.__self__
+         sec_scope = getattr(controller, '_security_scope', None)
+diff --git a/src/pybind/mgr/dashboard/services/ceph_service.py b/src/pybind/mgr/dashboard/services/ceph_service.py
+index a6eee2957e..89582e3f73 100644
+--- a/src/pybind/mgr/dashboard/services/ceph_service.py
++++ b/src/pybind/mgr/dashboard/services/ceph_service.py
+@@ -12,7 +12,7 @@ from .. import mgr
+ from ..exceptions import DashboardException
+ 
+ try:
+-    from typing import Dict, Any, Union  # pylint: disable=unused-import
++    from typing import Dict, Any, Union
+ except ImportError:
+     pass  # For typing only
+ 
+diff --git a/src/pybind/mgr/dashboard/services/cephx.py b/src/pybind/mgr/dashboard/services/cephx.py
+index ccda387961..60303ad85f 100644
+--- a/src/pybind/mgr/dashboard/services/cephx.py
++++ b/src/pybind/mgr/dashboard/services/cephx.py
+@@ -22,7 +22,7 @@ class CephX(object):
+ 
+     @classmethod
+     def list_clients(cls):
+-        return [client for client in cls._clients_map()]
++        return list(cls._clients_map())
+ 
+     @classmethod
+     def get_client_key(cls, client_id):
+diff --git a/src/pybind/mgr/dashboard/services/ganesha.py b/src/pybind/mgr/dashboard/services/ganesha.py
+index e9144db406..764ebb3739 100644
+--- a/src/pybind/mgr/dashboard/services/ganesha.py
++++ b/src/pybind/mgr/dashboard/services/ganesha.py
+@@ -69,7 +69,7 @@ class Ganesha(object):
+ 
+     @classmethod
+     def get_ganesha_clusters(cls):
+-        return [cluster_id for cluster_id in cls._get_clusters_locations()]
++        return list(cls._get_clusters_locations())
+ 
+     @staticmethod
+     def _get_orch_nfs_instances():
+@@ -325,7 +325,7 @@ class GaneshaConfParser(object):
+         for key, val in block.items():
+             if key == 'block_name':
+                 continue
+-            elif key == '_blocks_':
++            if key == '_blocks_':
+                 for blo in val:
+                     conf_str += GaneshaConfParser.write_block(blo, depth)
+             elif val:
+@@ -693,21 +693,21 @@ class Export(object):
+             result['attr_expiration_time'] = self.attr_expiration_time
+             result['security_label'] = self.security_label
+         if 'protocols' not in defaults:
+-            result['protocols'] = [p for p in self.protocols]
++            result['protocols'] = list(self.protocols)
+         else:
+             def_proto = defaults['protocols']
+             if not isinstance(def_proto, list):
+                 def_proto = set([def_proto])
+             if self.protocols != def_proto:
+-                result['protocols'] = [p for p in self.protocols]
++                result['protocols'] = list(self.protocols)
+         if 'transports' not in defaults:
+-            result['transports'] = [t for t in self.transports]
++            result['transports'] = list(self.transports)
+         else:
+             def_transp = defaults['transports']
+             if not isinstance(def_transp, list):
+                 def_transp = set([def_transp])
+             if self.transports != def_transp:
+-                result['transports'] = [t for t in self.transports]
++                result['transports'] = list(self.transports)
+ 
+         result['_blocks_'] = [self.fsal.to_fsal_block()]
+         result['_blocks_'].extend([client.to_client_block()
+@@ -737,14 +737,14 @@ class Export(object):
+             'path': self.path,
+             'fsal': self.fsal.to_dict(),
+             'cluster_id': self.cluster_id,
+-            'daemons': sorted([d for d in self.daemons]),
++            'daemons': sorted(list(self.daemons)),
+             'pseudo': self.pseudo,
+             'tag': self.tag,
+             'access_type': self.access_type,
+             'squash': self.squash,
+             'security_label': self.security_label,
+-            'protocols': sorted([p for p in self.protocols]),
+-            'transports': sorted([t for t in self.transports]),
++            'protocols': sorted(list(self.protocols)),
++            'transports': sorted(list(self.transports)),
+             'clients': [client.to_dict() for client in self.clients]
+         }
+ 
+@@ -992,7 +992,7 @@ class GaneshaConf(object):
+         return None
+ 
+     def list_daemons(self):
+-        return [daemon_id for daemon_id in self.daemons_conf_blocks]
++        return list(self.daemons_conf_blocks)
+ 
+     def reload_daemons(self, daemons):
+         with mgr.rados.open_ioctx(self.rados_pool) as ioctx:
+diff --git a/src/pybind/mgr/dashboard/services/iscsi_client.py b/src/pybind/mgr/dashboard/services/iscsi_client.py
+index b82a51a3d4..c5a6dfa0e7 100644
+--- a/src/pybind/mgr/dashboard/services/iscsi_client.py
++++ b/src/pybind/mgr/dashboard/services/iscsi_client.py
+@@ -12,7 +12,7 @@ try:
+ except ImportError:
+     from urllib.parse import urlparse
+ 
+-from .iscsi_config import IscsiGatewaysConfig  # pylint: disable=cyclic-import
++from .iscsi_config import IscsiGatewaysConfig
+ from ..settings import Settings
+ from ..rest_client import RestClient
+ 
+diff --git a/src/pybind/mgr/dashboard/services/iscsi_config.py b/src/pybind/mgr/dashboard/services/iscsi_config.py
+index ab90048500..86bdfc770d 100644
+--- a/src/pybind/mgr/dashboard/services/iscsi_config.py
++++ b/src/pybind/mgr/dashboard/services/iscsi_config.py
+@@ -57,7 +57,7 @@ class IscsiGatewaysConfig(object):
+         """
+         for gateway_name, gateway_config in config['gateways'].items():
+             if '.' not in gateway_name:
+-                from .iscsi_client import IscsiClient
++                from .iscsi_client import IscsiClient  # pylint: disable=cyclic-import
+                 from ..rest_client import RequestException
+                 try:
+                     service_url = gateway_config['service_url']
+diff --git a/src/pybind/mgr/dashboard/services/progress.py b/src/pybind/mgr/dashboard/services/progress.py
+index d8cf7521fa..d7b9ed973b 100644
+--- a/src/pybind/mgr/dashboard/services/progress.py
++++ b/src/pybind/mgr/dashboard/services/progress.py
+@@ -12,7 +12,7 @@ from __future__ import absolute_import
+ from datetime import datetime
+ import logging
+ 
+-from . import rbd
++from . import rbd  # pylint: disable=no-name-in-module
+ from .. import mgr
+ 
+ 
+diff --git a/src/pybind/mgr/dashboard/services/rgw_client.py b/src/pybind/mgr/dashboard/services/rgw_client.py
+index 5507eb6800..aee18acc54 100644
+--- a/src/pybind/mgr/dashboard/services/rgw_client.py
++++ b/src/pybind/mgr/dashboard/services/rgw_client.py
+@@ -16,7 +16,7 @@ from ..tools import build_url, dict_contains_path, json_str_to_object,\
+ from .. import mgr
+ 
+ try:
+-    from typing import Dict, List, Optional  # pylint: disable=unused-import
++    from typing import Dict, List, Optional
+ except ImportError:
+     pass  # For typing only
+ 
+@@ -303,6 +303,7 @@ class RgwClient(RestClient):
+         if self.userid != RgwClient._SYSTEM_USERID:
+             logger.info("Fetching new keys for user: %s", self.userid)
+             keys = RgwClient.admin_instance().get_user_keys(self.userid)
++            # pylint: disable=attribute-defined-outside-init
+             self.auth = S3Auth(keys['access_key'], keys['secret_key'],
+                                service_url=self.service_url)
+         else:
+diff --git a/src/pybind/mgr/dashboard/tests/__init__.py b/src/pybind/mgr/dashboard/tests/__init__.py
+index 421378a155..8eb5bb8af1 100644
+--- a/src/pybind/mgr/dashboard/tests/__init__.py
++++ b/src/pybind/mgr/dashboard/tests/__init__.py
+@@ -21,7 +21,7 @@ from ..services.auth import AuthManagerTool
+ from ..services.exception import dashboard_exception_handler
+ 
+ from ..plugins import PLUGIN_MANAGER
+-from ..plugins import feature_toggles, debug  # noqa # pylint: disable=unused-import
++from ..plugins import feature_toggles, debug  # noqa
+ 
+ 
+ PLUGIN_MANAGER.hook.init()
+diff --git a/src/pybind/mgr/dashboard/tests/helper.py b/src/pybind/mgr/dashboard/tests/helper.py
+index 9ec043d6be..06b83d42a8 100644
+--- a/src/pybind/mgr/dashboard/tests/helper.py
++++ b/src/pybind/mgr/dashboard/tests/helper.py
+@@ -2,7 +2,7 @@
+ from __future__ import absolute_import
+ 
+ try:
+-    from typing import Dict, Any  # pylint: disable=unused-import
++    from typing import Dict, Any
+ except ImportError:
+     pass
+ 
+diff --git a/src/pybind/mgr/dashboard/tests/test_access_control.py b/src/pybind/mgr/dashboard/tests/test_access_control.py
+index 0039efc167..81604a161e 100644
+--- a/src/pybind/mgr/dashboard/tests/test_access_control.py
++++ b/src/pybind/mgr/dashboard/tests/test_access_control.py
+@@ -9,7 +9,7 @@ import unittest
+ 
+ from datetime import datetime, timedelta
+ 
+-from . import CmdException, CLICommandTestMixin
++from . import CmdException, CLICommandTestMixin  # pylint: disable=no-name-in-module
+ from .. import mgr
+ from ..security import Scope, Permission
+ from ..services.access_control import load_access_control_db, \
+diff --git a/src/pybind/mgr/dashboard/tests/test_api_auditing.py b/src/pybind/mgr/dashboard/tests/test_api_auditing.py
+index 0416c03638..023ea7992a 100644
+--- a/src/pybind/mgr/dashboard/tests/test_api_auditing.py
++++ b/src/pybind/mgr/dashboard/tests/test_api_auditing.py
+@@ -9,7 +9,7 @@ try:
+ except ImportError:
+     import unittest.mock as mock
+ 
+-from . import ControllerTestCase, KVStoreMockMixin
++from . import ControllerTestCase, KVStoreMockMixin  # pylint: disable=no-name-in-module
+ from ..controllers import RESTController, Controller
+ from ..tools import RequestLoggingTool
+ from .. import mgr
+diff --git a/src/pybind/mgr/dashboard/tests/test_cephfs.py b/src/pybind/mgr/dashboard/tests/test_cephfs.py
+index e9abda5380..778b0aa275 100644
+--- a/src/pybind/mgr/dashboard/tests/test_cephfs.py
++++ b/src/pybind/mgr/dashboard/tests/test_cephfs.py
+@@ -6,7 +6,7 @@ except ImportError:
+     from unittest.mock import Mock
+ 
+ from .. import mgr
+-from . import ControllerTestCase
++from . import ControllerTestCase  # pylint: disable=no-name-in-module
+ from ..controllers.cephfs import CephFS
+ 
+ 
+diff --git a/src/pybind/mgr/dashboard/tests/test_controllers.py b/src/pybind/mgr/dashboard/tests/test_controllers.py
+index 0e88047061..b14878ff2e 100644
+--- a/src/pybind/mgr/dashboard/tests/test_controllers.py
++++ b/src/pybind/mgr/dashboard/tests/test_controllers.py
+@@ -1,7 +1,7 @@
+ # -*- coding: utf-8 -*-
+ from __future__ import absolute_import
+ 
+-from . import ControllerTestCase
++from . import ControllerTestCase  # pylint: disable=no-name-in-module
+ from ..controllers import BaseController, RESTController, Controller, \
+                           ApiController, Endpoint
+ 
+diff --git a/src/pybind/mgr/dashboard/tests/test_docs.py b/src/pybind/mgr/dashboard/tests/test_docs.py
+index a6e03b5267..ccb777aca5 100644
+--- a/src/pybind/mgr/dashboard/tests/test_docs.py
++++ b/src/pybind/mgr/dashboard/tests/test_docs.py
+@@ -1,7 +1,7 @@
+ # # -*- coding: utf-8 -*-
+ from __future__ import absolute_import
+ 
+-from . import ControllerTestCase
++from . import ControllerTestCase  # pylint: disable=no-name-in-module
+ from ..controllers import RESTController, ApiController, Endpoint, EndpointDoc, ControllerDoc
+ from ..controllers.docs import Docs
+ 
+diff --git a/src/pybind/mgr/dashboard/tests/test_erasure_code_profile.py b/src/pybind/mgr/dashboard/tests/test_erasure_code_profile.py
+index 557b7c1061..d266735e8f 100644
+--- a/src/pybind/mgr/dashboard/tests/test_erasure_code_profile.py
++++ b/src/pybind/mgr/dashboard/tests/test_erasure_code_profile.py
+@@ -1,7 +1,7 @@
+ # -*- coding: utf-8 -*-
+ 
+ from .. import mgr
+-from . import ControllerTestCase
++from . import ControllerTestCase  # pylint: disable=no-name-in-module
+ from ..controllers.erasure_code_profile import ErasureCodeProfile
+ 
+ 
+diff --git a/src/pybind/mgr/dashboard/tests/test_exceptions.py b/src/pybind/mgr/dashboard/tests/test_exceptions.py
+index 2bb25da1bf..b42c356479 100644
+--- a/src/pybind/mgr/dashboard/tests/test_exceptions.py
++++ b/src/pybind/mgr/dashboard/tests/test_exceptions.py
+@@ -5,7 +5,7 @@ import time
+ 
+ import rados
+ 
+-from . import ControllerTestCase
++from . import ControllerTestCase  # pylint: disable=no-name-in-module
+ from ..services.ceph_service import SendCommandError
+ from ..controllers import RESTController, Controller, Task, Endpoint
+ from ..services.exception import handle_rados_error, handle_send_command_error, \
+diff --git a/src/pybind/mgr/dashboard/tests/test_feature_toggles.py b/src/pybind/mgr/dashboard/tests/test_feature_toggles.py
+index 031d0ef839..23068c5eda 100644
+--- a/src/pybind/mgr/dashboard/tests/test_feature_toggles.py
++++ b/src/pybind/mgr/dashboard/tests/test_feature_toggles.py
+@@ -7,7 +7,7 @@ try:
+ except ImportError:
+     from unittest.mock import Mock, patch
+ 
+-from . import KVStoreMockMixin
++from . import KVStoreMockMixin  # pylint: disable=no-name-in-module
+ from ..plugins.feature_toggles import FeatureToggles, Features
+ 
+ 
+diff --git a/src/pybind/mgr/dashboard/tests/test_ganesha.py b/src/pybind/mgr/dashboard/tests/test_ganesha.py
+index 03f1f5b551..44498ac40c 100644
+--- a/src/pybind/mgr/dashboard/tests/test_ganesha.py
++++ b/src/pybind/mgr/dashboard/tests/test_ganesha.py
+@@ -9,7 +9,7 @@ except ImportError:
+     from unittest.mock import MagicMock, Mock
+ 
+ import orchestrator
+-from . import KVStoreMockMixin
++from . import KVStoreMockMixin  # pylint: disable=no-name-in-module
+ from .. import mgr
+ from ..settings import Settings
+ from ..services import ganesha
+diff --git a/src/pybind/mgr/dashboard/tests/test_grafana.py b/src/pybind/mgr/dashboard/tests/test_grafana.py
+index 0eb46bf0f0..a5456905f2 100644
+--- a/src/pybind/mgr/dashboard/tests/test_grafana.py
++++ b/src/pybind/mgr/dashboard/tests/test_grafana.py
+@@ -8,7 +8,7 @@ except ImportError:
+ 
+ from requests import RequestException
+ 
+-from . import ControllerTestCase, KVStoreMockMixin
++from . import ControllerTestCase, KVStoreMockMixin  # pylint: disable=no-name-in-module
+ from ..controllers.grafana import Grafana
+ from ..grafana import GrafanaRestClient
+ from ..settings import Settings
+diff --git a/src/pybind/mgr/dashboard/tests/test_home.py b/src/pybind/mgr/dashboard/tests/test_home.py
+index c3088b7a65..c942eed9be 100644
+--- a/src/pybind/mgr/dashboard/tests/test_home.py
++++ b/src/pybind/mgr/dashboard/tests/test_home.py
+@@ -8,7 +8,7 @@ try:
+ except ImportError:
+     import unittest.mock as mock
+ 
+-from . import ControllerTestCase, FakeFsMixin
++from . import ControllerTestCase, FakeFsMixin  # pylint: disable=no-name-in-module
+ from .. import mgr
+ 
+ from ..controllers.home import HomeController, LanguageMixin
+diff --git a/src/pybind/mgr/dashboard/tests/test_host.py b/src/pybind/mgr/dashboard/tests/test_host.py
+index ab7286074b..191c3f1245 100644
+--- a/src/pybind/mgr/dashboard/tests/test_host.py
++++ b/src/pybind/mgr/dashboard/tests/test_host.py
+@@ -7,7 +7,7 @@ except ImportError:
+ 
+ from orchestrator import HostSpec
+ 
+-from . import ControllerTestCase
++from . import ControllerTestCase  # pylint: disable=no-name-in-module
+ from ..controllers.host import get_hosts, Host, HostUi
+ from .. import mgr
+ 
+diff --git a/src/pybind/mgr/dashboard/tests/test_iscsi.py b/src/pybind/mgr/dashboard/tests/test_iscsi.py
+index 962ffeb684..72d64453ac 100644
+--- a/src/pybind/mgr/dashboard/tests/test_iscsi.py
++++ b/src/pybind/mgr/dashboard/tests/test_iscsi.py
+@@ -10,7 +10,8 @@ try:
+ except ImportError:
+     import unittest.mock as mock
+ 
+-from . import CmdException, ControllerTestCase, CLICommandTestMixin, KVStoreMockMixin
++from . import CmdException, ControllerTestCase, CLICommandTestMixin, \
++    KVStoreMockMixin  # pylint: disable=no-name-in-module
+ from .. import mgr
+ from ..controllers.iscsi import Iscsi, IscsiTarget
+ from ..services.iscsi_client import IscsiClient
+diff --git a/src/pybind/mgr/dashboard/tests/test_orchestrator.py b/src/pybind/mgr/dashboard/tests/test_orchestrator.py
+index 714d59c085..9a9d179bbc 100644
+--- a/src/pybind/mgr/dashboard/tests/test_orchestrator.py
++++ b/src/pybind/mgr/dashboard/tests/test_orchestrator.py
+@@ -6,7 +6,7 @@ except ImportError:
+ 
+ from orchestrator import InventoryHost
+ 
+-from . import ControllerTestCase
++from . import ControllerTestCase  # pylint: disable=no-name-in-module
+ from .. import mgr
+ from ..controllers.orchestrator import get_device_osd_map
+ from ..controllers.orchestrator import Orchestrator
+diff --git a/src/pybind/mgr/dashboard/tests/test_osd.py b/src/pybind/mgr/dashboard/tests/test_osd.py
+index aeb32ed576..063705ddbb 100644
+--- a/src/pybind/mgr/dashboard/tests/test_osd.py
++++ b/src/pybind/mgr/dashboard/tests/test_osd.py
+@@ -11,11 +11,11 @@ except ImportError:
+ from ceph.deployment.drive_group import DeviceSelection, DriveGroupSpec
+ from ceph.deployment.service_spec import PlacementSpec
+ 
+-from . import ControllerTestCase
++from . import ControllerTestCase  # pylint: disable=no-name-in-module
+ from ..controllers.osd import Osd
+ from ..tools import NotificationQueue, TaskManager
+ from .. import mgr
+-from .helper import update_dict
++from .helper import update_dict  # pylint: disable=import-error
+ 
+ try:
+     from typing import List, Dict, Any  # pylint: disable=unused-import
+diff --git a/src/pybind/mgr/dashboard/tests/test_plugin_debug.py b/src/pybind/mgr/dashboard/tests/test_plugin_debug.py
+index 4985540046..cb4d1afc21 100644
+--- a/src/pybind/mgr/dashboard/tests/test_plugin_debug.py
++++ b/src/pybind/mgr/dashboard/tests/test_plugin_debug.py
+@@ -1,7 +1,7 @@
+ # -*- coding: utf-8 -*-
+ from __future__ import absolute_import
+ 
+-from . import CLICommandTestMixin, ControllerTestCase
++from . import CLICommandTestMixin, ControllerTestCase  # pylint: disable=no-name-in-module
+ 
+ 
+ class TestPluginDebug(ControllerTestCase, CLICommandTestMixin):
+diff --git a/src/pybind/mgr/dashboard/tests/test_pool.py b/src/pybind/mgr/dashboard/tests/test_pool.py
+index e33e436540..179a8feeed 100644
+--- a/src/pybind/mgr/dashboard/tests/test_pool.py
++++ b/src/pybind/mgr/dashboard/tests/test_pool.py
+@@ -6,7 +6,7 @@ try:
+ except ImportError:
+     import unittest.mock as mock
+ 
+-from . import ControllerTestCase
++from . import ControllerTestCase  # pylint: disable=no-name-in-module
+ from ..controllers.pool import Pool
+ from ..controllers.task import Task
+ from ..tools import NotificationQueue, TaskManager
+diff --git a/src/pybind/mgr/dashboard/tests/test_prometheus.py b/src/pybind/mgr/dashboard/tests/test_prometheus.py
+index 3385d66a97..ef669a6203 100644
+--- a/src/pybind/mgr/dashboard/tests/test_prometheus.py
++++ b/src/pybind/mgr/dashboard/tests/test_prometheus.py
+@@ -5,7 +5,7 @@ try:
+ except ImportError:
+     from unittest.mock import patch
+ 
+-from . import ControllerTestCase
++from . import ControllerTestCase  # pylint: disable=no-name-in-module
+ from .. import mgr
+ from ..controllers.prometheus import Prometheus, PrometheusReceiver, PrometheusNotifications
+ 
+diff --git a/src/pybind/mgr/dashboard/tests/test_rbd_mirroring.py b/src/pybind/mgr/dashboard/tests/test_rbd_mirroring.py
+index ecb4856dc1..d7e0c7dd1e 100644
+--- a/src/pybind/mgr/dashboard/tests/test_rbd_mirroring.py
++++ b/src/pybind/mgr/dashboard/tests/test_rbd_mirroring.py
+@@ -6,7 +6,7 @@ try:
+ except ImportError:
+     import unittest.mock as mock
+ 
+-from . import ControllerTestCase
++from . import ControllerTestCase  # pylint: disable=no-name-in-module
+ from .. import mgr
+ from ..controllers.summary import Summary
+ from ..controllers.rbd_mirroring import RbdMirroring, RbdMirroringSummary, \
+diff --git a/src/pybind/mgr/dashboard/tests/test_rest_tasks.py b/src/pybind/mgr/dashboard/tests/test_rest_tasks.py
+index e9d7907f05..aa158cd288 100644
+--- a/src/pybind/mgr/dashboard/tests/test_rest_tasks.py
++++ b/src/pybind/mgr/dashboard/tests/test_rest_tasks.py
+@@ -8,7 +8,7 @@ try:
+ except ImportError:
+     import unittest.mock as mock
+ 
+-from . import ControllerTestCase
++from . import ControllerTestCase  # pylint: disable=no-name-in-module
+ from ..controllers import Controller, RESTController, Task
+ from ..controllers.task import Task as TaskController
+ from ..services import progress
+diff --git a/src/pybind/mgr/dashboard/tests/test_rgw.py b/src/pybind/mgr/dashboard/tests/test_rgw.py
+index 2c90e7d11b..11818ca2b7 100644
+--- a/src/pybind/mgr/dashboard/tests/test_rgw.py
++++ b/src/pybind/mgr/dashboard/tests/test_rgw.py
+@@ -3,7 +3,7 @@ try:
+ except ImportError:
+     import unittest.mock as mock
+ 
+-from . import ControllerTestCase
++from . import ControllerTestCase  # pylint: disable=no-name-in-module
+ from ..controllers.rgw import RgwUser
+ 
+ 
+diff --git a/src/pybind/mgr/dashboard/tests/test_rgw_client.py b/src/pybind/mgr/dashboard/tests/test_rgw_client.py
+index d69ab2f48d..fa711b45ca 100644
+--- a/src/pybind/mgr/dashboard/tests/test_rgw_client.py
++++ b/src/pybind/mgr/dashboard/tests/test_rgw_client.py
+@@ -9,7 +9,7 @@ except ImportError:
+ 
+ from ..services.rgw_client import RgwClient, _parse_frontend_config
+ from ..settings import Settings
+-from . import KVStoreMockMixin
++from . import KVStoreMockMixin  # pylint: disable=no-name-in-module
+ 
+ 
+ class RgwClientTest(unittest.TestCase, KVStoreMockMixin):
+diff --git a/src/pybind/mgr/dashboard/tests/test_settings.py b/src/pybind/mgr/dashboard/tests/test_settings.py
+index da54a20655..abdb059c1d 100644
+--- a/src/pybind/mgr/dashboard/tests/test_settings.py
++++ b/src/pybind/mgr/dashboard/tests/test_settings.py
+@@ -3,7 +3,7 @@ from __future__ import absolute_import
+ 
+ import errno
+ import unittest
+-from . import KVStoreMockMixin, ControllerTestCase
++from . import KVStoreMockMixin, ControllerTestCase  # pylint: disable=no-name-in-module
+ from .. import settings
+ from ..controllers.settings import Settings as SettingsController
+ from ..settings import Settings, handle_option_command
+diff --git a/src/pybind/mgr/dashboard/tests/test_sso.py b/src/pybind/mgr/dashboard/tests/test_sso.py
+index f8681b89ed..e8141a09cc 100644
+--- a/src/pybind/mgr/dashboard/tests/test_sso.py
++++ b/src/pybind/mgr/dashboard/tests/test_sso.py
+@@ -5,7 +5,8 @@ from __future__ import absolute_import
+ import errno
+ import unittest
+ 
+-from . import CmdException, exec_dashboard_cmd, KVStoreMockMixin
++from . import CmdException, exec_dashboard_cmd, \
++    KVStoreMockMixin  # pylint: disable=no-name-in-module
+ from ..services.sso import handle_sso_command, load_sso_db
+ 
+ 
+diff --git a/src/pybind/mgr/dashboard/tests/test_tools.py b/src/pybind/mgr/dashboard/tests/test_tools.py
+index 0f27ec8e63..340ff8c41d 100644
+--- a/src/pybind/mgr/dashboard/tests/test_tools.py
++++ b/src/pybind/mgr/dashboard/tests/test_tools.py
+@@ -10,7 +10,7 @@ try:
+ except ImportError:
+     from unittest.mock import patch
+ 
+-from . import ControllerTestCase
++from . import ControllerTestCase  # pylint: disable=no-name-in-module
+ from ..services.exception import handle_rados_error
+ from ..controllers import RESTController, ApiController, Controller, \
+                           BaseController, Proxy
+diff --git a/src/pybind/mgr/dashboard/tools.py b/src/pybind/mgr/dashboard/tools.py
+index 2b6d92ca55..d9a2d813c0 100644
+--- a/src/pybind/mgr/dashboard/tools.py
++++ b/src/pybind/mgr/dashboard/tools.py
+@@ -30,7 +30,7 @@ from .services.auth import JwtManager
+ 
+ try:
+     from typing import Any, AnyStr, Callable, DefaultDict, Deque,\
+-        Dict, List, Set, Tuple, Union  # noqa pylint: disable=unused-import
++        Dict, List, Set, Tuple, Union  # noqa
+ except ImportError:
+     pass  # For typing only
+ 

Added: qa-src-update-mypy-to-0.782.patch
===================================================================
--- qa-src-update-mypy-to-0.782.patch	                        (rev 0)
+++ qa-src-update-mypy-to-0.782.patch	2020-11-26 03:52:24 UTC (rev 761400)
@@ -0,0 +1,65 @@
+From a61e8e3b6052bf158fe63ab1cd66197f4ffc3900 Mon Sep 17 00:00:00 2001
+From: Sebastian Wagner <sebastian.wagner at suse.com>
+Date: Thu, 25 Jun 2020 14:11:54 +0200
+Subject: [PATCH] qa,src: update mypy to 0.782
+
+(cherry picked from commit 78f3473f55afe14698dc702e24cf34030223a373)
+---
+ qa/tox.ini                              | 2 +-
+ src/pybind/mgr/dashboard/rest_client.py | 2 +-
+ src/pybind/mgr/tox.ini                  | 2 +-
+ src/python-common/requirements.txt      | 2 +-
+ 4 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/qa/tox.ini b/qa/tox.ini
+index 31a1ef4fd4..33ad2db968 100644
+--- a/qa/tox.ini
++++ b/qa/tox.ini
+@@ -16,7 +16,7 @@ commands=flake8 --select=F,E9 --exclude=venv,.tox
+ 
+ [testenv:mypy]
+ basepython = python3
+-deps = mypy==0.770
++deps = mypy==0.782
+ commands = mypy {posargs:.}
+ 
+ [testenv:pytest]
+diff --git a/src/pybind/mgr/dashboard/rest_client.py b/src/pybind/mgr/dashboard/rest_client.py
+index 4d58d0dfde..7c04f36a0d 100644
+--- a/src/pybind/mgr/dashboard/rest_client.py
++++ b/src/pybind/mgr/dashboard/rest_client.py
+@@ -511,7 +511,7 @@ class RestClient(object):
+                 resp_structure = api_kwargs.get('resp_structure', None)
+                 args_name = inspect.getargspec(func).args
+                 args_dict = dict(zip(args_name[1:], args))
+-                for key, val in kwargs:
++                for key, val in kwargs.items():
+                     args_dict[key] = val
+                 return func(
+                     self,
+diff --git a/src/pybind/mgr/tox.ini b/src/pybind/mgr/tox.ini
+index 3e129ba64e..4c65be7f16 100644
+--- a/src/pybind/mgr/tox.ini
++++ b/src/pybind/mgr/tox.ini
+@@ -47,7 +47,7 @@ basepython = python3
+ deps =
+     cython
+     -rrequirements.txt
+-    mypy==0.770
++    mypy==0.782
+ commands =
+     mypy --config-file=../../mypy.ini \
+            cephadm/module.py \
+diff --git a/src/python-common/requirements.txt b/src/python-common/requirements.txt
+index a269fada78..7df43fb736 100644
+--- a/src/python-common/requirements.txt
++++ b/src/python-common/requirements.txt
+@@ -1,7 +1,7 @@
+ six
+ pytest >=2.1.3,<5; python_version < '3.5'
+ mock; python_version < '3.3'
+-mypy==0.770; python_version >= '3'
++mypy==0.782; python_version >= '3'
+ pytest-mypy; python_version >= '3'
+ pytest >= 2.1.3; python_version >= '3'
+ pyyaml



More information about the arch-commits mailing list