From: Ernesto Puerta Date: Mon, 2 Sep 2019 17:40:10 +0000 (+0200) Subject: mgr/dashboard: disable pylint's --py3k flag X-Git-Tag: v15.1.0~1625^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=bf94281d0da43a617a0720503532ae4dde44ab2e;p=ceph.git mgr/dashboard: disable pylint's --py3k flag This flag, instead of just improving Python 2 to 3 compatibility checks, disables a few other checks. Fixes: https://tracker.ceph.com/issues/41602 Signed-off-by: Ernesto Puerta --- diff --git a/src/pybind/mgr/dashboard/services/sso.py b/src/pybind/mgr/dashboard/services/sso.py index 7cfe4e3f1da..387aa3888c3 100644 --- a/src/pybind/mgr/dashboard/services/sso.py +++ b/src/pybind/mgr/dashboard/services/sso.py @@ -9,11 +9,14 @@ import threading import warnings import six -if six.PY2: - FileNotFoundError = IOError - from six.moves.urllib import parse +from .. import mgr, logger +from ..tools import prepare_url_prefix + +if six.PY2: + FileNotFoundError = IOError # pylint: disable=redefined-builtin + try: from onelogin.saml2.settings import OneLogin_Saml2_Settings as Saml2Settings from onelogin.saml2.errors import OneLogin_Saml2_Error as Saml2Error @@ -24,10 +27,6 @@ except ImportError: python_saml_imported = False -from .. import mgr, logger -from ..tools import prepare_url_prefix - - class Saml2(object): def __init__(self, onelogin_settings): self.onelogin_settings = onelogin_settings diff --git a/src/pybind/mgr/dashboard/tox.ini b/src/pybind/mgr/dashboard/tox.ini index 6342704c588..f760d79f889 100644 --- a/src/pybind/mgr/dashboard/tox.ini +++ b/src/pybind/mgr/dashboard/tox.ini @@ -61,8 +61,6 @@ addopts = -rn --rcfile=.pylintrc --jobs={[pylint]jobs} -# Detect Python 2-3 migration issues - --py3k [rstlint] dirs = @@ -72,6 +70,8 @@ dirs = [testenv:lint] basepython=python3 deps = + -rrequirements.txt + -cconstraints.txt -rrequirements-lint.txt commands = lint: flake8 {posargs}