This reverts the change[1] made earlier to workaround the issue caused
by usage of vendored version of six library in the django-pyscss
library.
The django-pyscss library no longer imports the vendored version of
six, since 2.0.3[2].
[1] 39f28ad5edacc31575d1de4971de56d765567b58
[2] 1499332e1d
Change-Id: I22802b75d6a8d8f35930709e89d64dd65982cef0
In python3, super() does not always require a class and self reference.
In other words, super() is enough for most cases.
This is much simpler and it is time to switch it to the newer style.
pylint provides a check for this.
Let's enable 'super-with-arguments' check.
NOTE: _prepare_mappings() method of FormRegion in
openstack_dashboard/test/integration_tests/regions/forms.py is refactored.
super() (without explicit class and self referece) does not work when
a subclass method calls a same method in a parent class multiple times.
It looks better to prepare a separate method to provide a common logic.
Change-Id: Id9512a14be9f20dbd5ebd63d446570c7b7c825ff
'unnecessary-comprehension' warning is emitted when
unnecessary use of a comprehension is found.
classes attribute in Action can be a tuple,
so we need list() to ensure it is a list before adding 'disabled'.
I think it is time to introduce a method in Action class or somewhere
but it should be handled separately.
Change-Id: I16a98d56b6d0bd0af234b00735c6ed576620df7e
This pylint check 'no-else-return' might be debatable.
but as far as I checked it works in most cases.
Change-Id: Ie8574d4a529454c6e050fa62a7a17ea097d00240
* Adds comments on pylint disabled checks
* Enable 'deprecated-method' check. We have no failures now.
* Convert global disabled checks 'no-value-for-parameter' and
'using-constant-test' to per-comment disables.
Other cleanup would be larger and/or better to be visited separately.
Change-Id: Id47dc8de4abcc8c744d96d2accf3a2a09ae206d4
pylint 2.2.2 which we currently use does not support python 3.8 [1].
Let's use a newer version of pylint.
pylint now declares strict versions for astroid and isort,
so we do not need to manage them in our test-requirements.txt.
All new checks are disabled temporarily. Let's visit them later and
judge whether we disable them permanently one by one.
[1] https://github.com/PyCQA/pylint/issues/2737
Change-Id: I106b250e632305365aaab4d881c9ba5ea93505b3
Use the real python executable as shebang
Use exec instead of execfile if using python 3
Change-Id: I8acea40851c7e9dc248751be967859b2b9430af7
Closes-Bug: #1836580
openstack_dashboard/api nova.py and cinder.py are imported
by each other. To avoid cyclic imports, some imports are placed
inside functions now, but it would be nice if we can move them
to a separate module and nova.py/cinder.py can import it.
This commit tries to achieve this by moving some stuffs in nova.py
into a separate module named _nova.py.
The module name starts with an underscore to clarify
it is intended to use only in openstack_dashboard.api.
Change-Id: If91cf4f30d2ddab471757129c2a74b26b6d38b1e
django.http.HttpResponseNotFound is not an exception.
Django recommends to return it. @rest_utils.ajax can handle it.
Change-Id: I26f82da022a2c2725d62cc136c5da8eafc0ac26f
horizon/forms/fields.py:
ThemableCheckboxSelectMultiple.__init__ does not have
arguments "name" and "value". They were specified before somehow.
openstack_dashboard/dashboards/project/instances/forms.py:
messages.error() does not have "redirect" argument.
We need to redirect explicitly.
Change-Id: Ib51abf136fb49e3be65005c5f48715f004379178
pylint complains 'name' argument is redundant
in positional and keyword arguments.
The existence of 'name' in kwargs is checked before passing to
api.keystone.tenant_create, so we can pass 'name' as part of kwargs.
Change-Id: Ice09cecb21217b042d44a8c1dda7a4736e2b391b
openstack_dashboard/dashboards/project/security_groups/forms.py:393:13: R1714: Consider merging these comparisons with "in" to "rule_menu in ('tcp', 'udp')" (consider-using-in)
openstack_dashboard/api/rest/json_encoder.py:61:15: R0124: Redundant comparison - o != o (comparison-with-itself)
openstack_dashboard/api/keystone.py:904:15: R1714: Consider merging these comparisons with "in" to 'default in (role.id, role.name)' (consider-using-in)
horizon/templatetags/truncate_filter.py:30:7: R1716: Simplify chained comparison between the operands (chained-comparison)
Change-Id: I6cf8602f88c4027ff12aaa4ea5a9f2069ae2e2a6
openstack_dashboard/dashboards/project/cgroups/workflows.py:313:8: R1702: Too many nested blocks (6/5) (too-many-nested-blocks)
openstack_auth/plugin/base.py:221:12: R1704: Redefining argument with the local name 'domain_name' (redefined-argument-from-local)
horizon/tables/formset.py:59:16: R1704: Redefining argument with the local name 'column' (redefined-argument-from-local)
Change-Id: Ifeb192efac83c0b2d5399c51f66c8fb8f8969fc0
openstack_dashboard/context_processors.py:94:15: C0122: Comparison should be link['url'] != 'horizon:project:api_access:openrcv2' (misplaced-comparison-constant)
openstack_dashboard/settings.py:467:4: C0412: Imports from package horizon are not grouped (ungrouped-imports)
openstack_dashboard/enabled/_1370_project_vg_snapshots.py:9:0: C0301: Line too long (86/80) (line-too-long)
openstack_dashboard/enabled/_1360_project_volume_groups.py:9:0: C0301: Line too long (85/80) (line-too-long)
openstack_dashboard/usage/base.py:62:8: W0106: Expression "[instance_list.extend(u.server_usages) for u in self.usage_list]" is assigned to nothing (expression-not-assigned)
openstack_dashboard/dashboards/project/images/utils.py:43:12: W0106: Expression "[public_images.append(image) for image in images]" is assigned to nothing (expression-not-assigned)
openstack_dashboard/dashboards/project/images/utils.py:75:12: W0106: Expression "[community_images.append(image) for image in images]" is assigned to nothing (expression-not-assigned)
openstack_dashboard/api/glance.py:47:4: C0412: Imports from package glanceclient are not grouped (ungrouped-imports)
openstack_dashboard/api/cinder.py:60:4: C0412: Imports from package cinderclient are not grouped (ungrouped-imports)
openstack_auth/user.py:358:4: E0211: Method has no argument (no-method-argument)
openstack_auth/user.py:362:4: E0211: Method has no argument (no-method-argument)
openstack_dashboard/api/keystone.py:75:4: C0412: Imports from package keystoneclient are not grouped (ungrouped-imports)
horizon/loaders.py:43:16: W0706: The except handler raises immediately (try-except-raise)
horizon/themes.py:174:8: W0706: The except handler raises immediately (try-except-raise)
Change-Id: I40cf3ffbc4519657e11180d2e2fe7401387c5556
It seems pylint cannot handle distutils imports
and shows "import-error" error. I believe it sounds
reasonable to ignore this case.
Change-Id: Ia08b4fbf8c3270aa37cd88967add8258f6b26377
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
horizon/forms/__init__.py exposed IPAddressField via __all__,
but IPAddressField does not exist in Django code.
It addresses pylint undefined-all-variable error.
Change-Id: I5e5cc802c0d75e91fad769cc381368b532561476
In case of Cell.status property, the code has a good readability,
so it sounds reasonable to ignore access-member-before-definition,
although access-member-before-definition itself is a useful check.
Change-Id: Ic6f2ec42bac41c62265e6b0e744c256007093ce6
tests.py files are excluded from targets checked by pylint
because it takes longer and longer time to check them somehow.
pylint 2.2.x is supported only in Python 3 and we already switched
our pep8 basepython to python3, so pylint and astroid are installed
only for python3. This seems the easiest way to ensure py27 env works.
literal-comparison error in openstack_dashboard/api/nova.py
is also fixed in this commit as it is simple enough.
Change-Id: Ic8868a44b296dba457be721716ca6f9d37ad9369