pylint: fixes several errors

openstack_dashboard/hooks.py:16:0: E0611: No name 'command' in module 'distutils' (no-name-in-module)

openstack_dashboard/dashboards/project/networks/ports/sg_base.py:52:12: E1111: Assigning result of a function call, where the function has no return (assignment-from-no-return)
BaseSecurityGroupsAction._get_initial_security_groups() is now marked
as abstract method because this method must be implemented in subclasses.
BaseSecurityGroupsAction.handle() is now dropped because there is
no difference from the parent class (horizon.workflows.Action).

openstack_auth/views.py:211:4: E1206: Not enough arguments for logging format string (logging-too-few-args)
openstack_auth/views.py:269:8: E1206: Not enough arguments for logging format string (logging-too-few-args)
openstack_auth/plugin/base.py:237:20: E1206: Not enough arguments for logging format string (logging-too-few-args)

horizon/base.py:166:24: E1133: Non-iterable value self.policy_rules is used in an iterating context (not-an-iterable)
horizon/tabs/base.py:489:40: E1133: Non-iterable value self.table_classes is used in an iterating context (not-an-iterable)

Change-Id: I0b045d04af251854b5017c9f698e3b40503a0724
This commit is contained in:
Akihiro Motoki 2018-12-01 22:44:52 +09:00
parent 6299fdbdc0
commit 6ce323307d
7 changed files with 9 additions and 14 deletions

View File

@ -10,14 +10,10 @@ disable=
# "I" Informational noise
locally-disabled,
# "E" Error for important programming issues (likely bugs)
assignment-from-no-return,
import-error,
logging-too-few-args,
method-hidden,
misplaced-bare-raise,
no-member,
no-name-in-module,
not-an-iterable,
not-callable,
raising-non-exception,
redundant-keyword-arg,

View File

@ -107,7 +107,7 @@ class NotRegistered(Exception):
@python_2_unicode_compatible
class HorizonComponent(object):
policy_rules = None
policy_rules = tuple()
def __init__(self):
super(HorizonComponent, self).__init__()

View File

@ -475,7 +475,7 @@ class TableTab(Tab):
need to define a corresponding ``get_{{ table_name }}_data`` method
as with :class:`~horizon.tables.MultiTableView`.
"""
table_classes = None
table_classes = []
def __init__(self, tab_group, request):
super(TableTab, self).__init__(tab_group, request)

View File

@ -236,6 +236,6 @@ class BasePlugin(object):
if len(domains) > 1:
LOG.info("More than one valid domain found for user %s,"
" scoping to %s",
(unscoped_auth_ref.user_id, domain_name))
unscoped_auth_ref.user_id, domain_name)
break
return domain_auth, domain_auth_ref

View File

@ -210,7 +210,7 @@ def logout(request, login_url=None, **kwargs):
def switch(request, tenant_id, redirect_field_name=auth.REDIRECT_FIELD_NAME):
"""Switches an authenticated user from one project to another."""
LOG.debug('Switching to tenant %s for user "%s".',
(tenant_id, request.user.username))
tenant_id, request.user.username)
endpoint, __ = utils.fix_auth_url_version_prefix(request.user.endpoint)
session = utils.get_session()
@ -268,7 +268,7 @@ def switch_region(request, region_name,
if region_name in request.user.available_services_regions:
request.session['services_region'] = region_name
LOG.debug('Switching services region to %s for user "%s".',
(region_name, request.user.username))
region_name, request.user.username)
redirect_to = request.GET.get(redirect_field_name, '')
if not is_safe_url(url=redirect_to, host=request.get_host()):

View File

@ -10,6 +10,8 @@
# License for the specific language governing permissions and limitations
# under the License.
import abc
from django.utils.translation import ugettext_lazy as _
from horizon import exceptions
@ -54,12 +56,8 @@ class BaseSecurityGroupsAction(workflows.MembershipAction):
exceptions.handle(request, err_msg)
self.fields[field_name].initial = sec_groups
@abc.abstractmethod
def _get_initial_security_groups(self, context):
# This depends on each cases
pass
def handle(self, request, data):
# This depends on each cases
pass

View File

@ -13,6 +13,7 @@
# License for the specific language governing permissions and limitations
# under the License.
# pylint: disable=no-name-in-module
from distutils.command import install