Browse Source

Update hacking for Python3

The repo is Python 3 now, so update hacking to version 3.0 which
supports Python 3.

Fix problems found.

Update local hacking checks for new flake8.

Remove hacking and friends from lower-constraints, those are not needed
for co-installing.

Change-Id: I926efaef501f190e78da9cab40c1e94203277258
changes/47/716347/2
Andreas Jaeger 2 years ago
parent
commit
ae228bb5cc
  1. 4
      lower-constraints.txt
  2. 2
      magnum/api/controllers/v1/cluster_template.py
  3. 2
      magnum/api/controllers/v1/types.py
  4. 2
      magnum/api/middleware/auth_token.py
  5. 2
      magnum/common/cert_manager/local_cert_manager.py
  6. 2
      magnum/common/exception.py
  7. 3
      magnum/common/short_id.py
  8. 16
      magnum/conductor/handlers/common/cert_manager.py
  9. 4
      magnum/db/sqlalchemy/alembic/versions/041d9a0f1159_add_flavor_id_to_cluster.py
  10. 2
      magnum/db/sqlalchemy/alembic/versions/049f81f6f584_remove_ssh_authorized_key_from_baymodel.py
  11. 4
      magnum/db/sqlalchemy/alembic/versions/04c625aa95ba_change_storage_driver_to_string.py
  12. 8
      magnum/db/sqlalchemy/alembic/versions/05d3e97de9ee_add_volume_driver.py
  13. 2
      magnum/db/sqlalchemy/alembic/versions/085e601a39f6_remove_service.py
  14. 4
      magnum/db/sqlalchemy/alembic/versions/14328d6a57e3_add_master_count_to_bay.py
  15. 4
      magnum/db/sqlalchemy/alembic/versions/1481f5b560dd_add_labels_column_to_baymodel_table.py
  16. 4
      magnum/db/sqlalchemy/alembic/versions/156ceb17fb0a_add_bay_status_reason.py
  17. 4
      magnum/db/sqlalchemy/alembic/versions/1afee1db6cd0_add_master_flavor.py
  18. 4
      magnum/db/sqlalchemy/alembic/versions/1c1ff5e56048_rename_container_image_id.py
  19. 4
      magnum/db/sqlalchemy/alembic/versions/1d045384b966_add_insecure_baymodel_attr.py
  20. 2
      magnum/db/sqlalchemy/alembic/versions/1f196a3dabae_remove_container.py
  21. 8
      magnum/db/sqlalchemy/alembic/versions/2581ebaf0cb2_initial_migration.py
  22. 4
      magnum/db/sqlalchemy/alembic/versions/27ad304554e2_adding_magnum_service_functionality.py
  23. 4
      magnum/db/sqlalchemy/alembic/versions/29affeaa2bc2_rename_bay_master_address.py
  24. 4
      magnum/db/sqlalchemy/alembic/versions/2ace4006498_rename_bay_minions_address.py
  25. 4
      magnum/db/sqlalchemy/alembic/versions/2ae93c9c6191_add_public_column_to_baymodel_table.py
  26. 4
      magnum/db/sqlalchemy/alembic/versions/2b5f24dd95de_rename_service_port.py
  27. 4
      magnum/db/sqlalchemy/alembic/versions/2d1354bbf76e_ssh_authorized_key.py
  28. 4
      magnum/db/sqlalchemy/alembic/versions/2d8657c0cdc_add_bay_uuid.py
  29. 4
      magnum/db/sqlalchemy/alembic/versions/33ef79969018_add_memory_to_container.py
  30. 8
      magnum/db/sqlalchemy/alembic/versions/35cff7c86221_add_private_network_to_baymodel.py
  31. 4
      magnum/db/sqlalchemy/alembic/versions/3a938526b35d_add_docker_volume_size.py
  32. 2
      magnum/db/sqlalchemy/alembic/versions/3b6c4c42adb4_add_unique_constraints.py
  33. 8
      magnum/db/sqlalchemy/alembic/versions/3be65537a94a_add_network_driver_baymodel_column.py
  34. 4
      magnum/db/sqlalchemy/alembic/versions/3bea56f25597_multi_tenant.py
  35. 4
      magnum/db/sqlalchemy/alembic/versions/40f325033343_add_bay_create_timeout_to_bay.py
  36. 4
      magnum/db/sqlalchemy/alembic/versions/417917e778f5_add_server_type_to_baymodel.py
  37. 4
      magnum/db/sqlalchemy/alembic/versions/421102d1f2d2_create_x509keypair_table.py
  38. 4
      magnum/db/sqlalchemy/alembic/versions/456126c6c9e9_create_baylock_table.py
  39. 12
      magnum/db/sqlalchemy/alembic/versions/461d798132c7_change_cluster_to_support_nodegroups.py
  40. 8
      magnum/db/sqlalchemy/alembic/versions/47380964133d_add_network_subnet_fip_to_cluster.py
  41. 8
      magnum/db/sqlalchemy/alembic/versions/4956f03cabad_add_cluster_distro.py
  42. 4
      magnum/db/sqlalchemy/alembic/versions/4e263f236334_add_registry_enabled.py
  43. 8
      magnum/db/sqlalchemy/alembic/versions/4ea34a59a64c_add_discovery_url_to_bay.py
  44. 4
      magnum/db/sqlalchemy/alembic/versions/52bcaf58fecb_add_master_flavor_id_to_cluster.py
  45. 4
      magnum/db/sqlalchemy/alembic/versions/53882537ac57_add_host_column_to_pod.py
  46. 8
      magnum/db/sqlalchemy/alembic/versions/5518af8dbc21_rename_cert_uuid.py
  47. 4
      magnum/db/sqlalchemy/alembic/versions/5793cd26898d_add_bay_status.py
  48. 2
      magnum/db/sqlalchemy/alembic/versions/57fbdf2327a2_remove_baylock.py
  49. 10
      magnum/db/sqlalchemy/alembic/versions/592131657ca1_add_coe_column_to_baymodel.py
  50. 4
      magnum/db/sqlalchemy/alembic/versions/5977879072a7_add_env_to_container.py
  51. 4
      magnum/db/sqlalchemy/alembic/versions/59e7664a8ba1_add_container_status.py
  52. 4
      magnum/db/sqlalchemy/alembic/versions/5ad410481b88_rename_insecure.py
  53. 8
      magnum/db/sqlalchemy/alembic/versions/5d4caa6e0a42_create_trustee_for_each_bay.py
  54. 4
      magnum/db/sqlalchemy/alembic/versions/68ce16dfd341_add_master_lb_enabled_column_to_baymodel_table.py
  55. 4
      magnum/db/sqlalchemy/alembic/versions/6f21dc920bb_add_cert_uuid_to_bay.py
  56. 6
      magnum/db/sqlalchemy/alembic/versions/6f21dc998bb_add_master_addresses_to_bay.py
  57. 4
      magnum/db/sqlalchemy/alembic/versions/720f640f43d1_rename_bay_table_to_cluster.py
  58. 2
      magnum/db/sqlalchemy/alembic/versions/859fb45df249_remove_replication_controller.py
  59. 4
      magnum/db/sqlalchemy/alembic/versions/87e62e3c7abc_add_hidden_to_cluster_template.py
  60. 8
      magnum/db/sqlalchemy/alembic/versions/966a99e70ff_add_proxy.py
  61. 6
      magnum/db/sqlalchemy/alembic/versions/9a1539f1cd2c_add_federation_table.py
  62. 4
      magnum/db/sqlalchemy/alembic/versions/a0e7c8450ab1_add_labels_to_cluster.py
  63. 4
      magnum/db/sqlalchemy/alembic/versions/a1136d335540_add_docker_storage_driver_column.py
  64. 4
      magnum/db/sqlalchemy/alembic/versions/aa0cc27839af_add_docker_volume_size_to_cluster.py
  65. 8
      magnum/db/sqlalchemy/alembic/versions/ac92cbae311c_add_nodegoup_table.py
  66. 4
      magnum/db/sqlalchemy/alembic/versions/adc3b7679ae_add_registry_trust_id_to_bay.py
  67. 4
      magnum/db/sqlalchemy/alembic/versions/b1f612248cab_add_floating_ip_enabled_column_to_.py
  68. 2
      magnum/db/sqlalchemy/alembic/versions/bb42b7cad130_remove_node_object.py
  69. 4
      magnum/db/sqlalchemy/alembic/versions/bc46ba6cf949_add_keypair_to_cluster.py
  70. 6
      magnum/db/sqlalchemy/alembic/versions/c04e925e65c2_nodegroups_v2.py
  71. 4
      magnum/db/sqlalchemy/alembic/versions/cbbc65a86986_add_health_status_to_cluster.py
  72. 4
      magnum/db/sqlalchemy/alembic/versions/d072f58ab240_modify_x509keypair_table.py
  73. 8
      magnum/db/sqlalchemy/alembic/versions/e0653b2d5271_add_fixed_subnet_column_to_baymodel_table.py
  74. 8
      magnum/db/sqlalchemy/alembic/versions/e647f5931da8_add_insecure_registry_to_baymodel.py
  75. 4
      magnum/db/sqlalchemy/alembic/versions/e772b2598d9_add_container_command.py
  76. 4
      magnum/db/sqlalchemy/alembic/versions/ee92b41b8809_create_quotas_table.py
  77. 2
      magnum/db/sqlalchemy/alembic/versions/ef08a5e057bd_remove_pod.py
  78. 2
      magnum/db/sqlalchemy/alembic/versions/fb03fdef8919_rename_baymodel_to_clustertemplate.py
  79. 8
      magnum/db/sqlalchemy/alembic/versions/fcb4efee8f8b_add_version_info_to_bay.py
  80. 1
      magnum/db/sqlalchemy/models.py
  81. 2
      magnum/drivers/heat/driver.py
  82. 27
      magnum/hacking/checks.py
  83. 2
      magnum/tests/unit/api/controllers/v1/test_baymodel.py
  84. 2
      magnum/tests/unit/conductor/handlers/test_k8s_cluster_conductor.py
  85. 1
      magnum/tests/unit/service/test_periodic.py
  86. 8
      magnum/tests/unit/test_hacking.py
  87. 2
      test-requirements.txt
  88. 14
      tox.ini

4
lower-constraints.txt

@ -32,14 +32,12 @@ eventlet==0.18.2
extras==1.0.0
fasteners==0.14.1
fixtures==3.0.0
flake8==2.5.5
future==0.16.0
futurist==1.6.0
gitdb2==2.0.3
GitPython==2.1.8
google-auth==1.4.1
greenlet==0.4.13
hacking==0.12.0
idna==2.6
imagesize==1.0.0
ipaddress==1.0.19
@ -98,7 +96,6 @@ Paste==2.0.3
PasteDeploy==1.5.2
pbr==2.0.0
pecan==1.0.0
pep8==1.5.7
pika-pool==0.1.3
pika==0.10.0
prettytable==0.7.2
@ -107,7 +104,6 @@ pyasn1-modules==0.2.1
pyasn1==0.4.2
pycadf==1.1.0
pycparser==2.18
pyflakes==0.8.1
Pygments==2.2.0
pyinotify==0.9.6
pyOpenSSL==17.5.0

2
magnum/api/controllers/v1/cluster_template.py

@ -414,7 +414,7 @@ class ClusterTemplatesController(base.Controller):
new_cluster_template.uuid)
return ClusterTemplate.convert_with_links(new_cluster_template)
@wsme.validate(types.uuid_or_name, [ClusterTemplatePatchType])
@wsme.validate(types.uuid_or_name, [ClusterTemplatePatchType]) # noqa
@expose.expose(ClusterTemplate, types.uuid_or_name,
body=[ClusterTemplatePatchType])
@validation.enforce_network_driver_types_update()

2
magnum/api/controllers/v1/types.py

@ -152,7 +152,7 @@ boolean = BooleanType()
class JsonPatchType(wtypes.Base):
"""A complex type that represents a single json-patch operation."""
path = wtypes.wsattr(wtypes.StringType(pattern='^(/[\w-]+)+$'),
path = wtypes.wsattr(wtypes.StringType(pattern=r'^(/[\w-]+)+$'),
mandatory=True)
op = wtypes.wsattr(wtypes.Enum(wtypes.text, 'add', 'replace', 'remove'),
mandatory=True)

2
magnum/api/middleware/auth_token.py

@ -32,7 +32,7 @@ class AuthTokenMiddleware(auth_token.AuthProtocol):
def __init__(self, app, conf, public_api_routes=None):
if public_api_routes is None:
public_api_routes = []
route_pattern_tpl = '%s(\.json)?$'
route_pattern_tpl = r'%s(\.json)?$'
try:
self.public_api_routes = [re.compile(route_pattern_tpl % route_tpl)

2
magnum/common/cert_manager/local_cert_manager.py

@ -103,7 +103,7 @@ class CertManager(cert_manager.CertManager):
return cert_ref
@staticmethod
@staticmethod # noqa: C901
def get_cert(cert_ref, **kwargs):
"""Retrieves the specified cert.

2
magnum/common/exception.py

@ -37,7 +37,7 @@ CONF = magnum.conf.CONF
try:
CONF.import_opt('fatal_exception_format_errors',
'oslo_versionedobjects.exception')
except cfg.NoSuchOptError as e:
except cfg.NoSuchOptError:
# Note:work around for magnum run against master branch
# in devstack gate job, as magnum not branched yet
# verisonobjects kilo/master different version can

3
magnum/common/short_id.py

@ -31,7 +31,8 @@ def _to_byte_string(value, num_bits):
required.
"""
shifts = six.moves.xrange(num_bits - 8, -8, -8)
byte_at = lambda off: (value >> off if off >= 0 else value << -off) & 0xff
byte_at = lambda off: ((value >> off # noqa: E731
if off >= 0 else value << -off) & 0xff)
return ''.join(chr(byte_at(offset)) for offset in shifts)

16
magnum/conductor/handlers/common/cert_manager.py

@ -233,11 +233,11 @@ def delete_certificates_from_cluster(cluster, context=None):
def delete_client_files(cluster, context=None):
cached_cert_dir = os.path.join(CONF.cluster.temp_cache_dir,
cluster.uuid)
try:
if os.path.isdir(cached_cert_dir):
shutil.rmtree(cached_cert_dir)
except Exception:
LOG.warning("Deleting client files failed for Cluster %s",
cluster.uuid)
cached_cert_dir = os.path.join(CONF.cluster.temp_cache_dir,
cluster.uuid)
try:
if os.path.isdir(cached_cert_dir):
shutil.rmtree(cached_cert_dir)
except Exception:
LOG.warning("Deleting client files failed for Cluster %s",
cluster.uuid)

4
magnum/db/sqlalchemy/alembic/versions/041d9a0f1159_add_flavor_id_to_cluster.py

@ -21,8 +21,8 @@ Create Date: 2017-07-31 12:46:00.777841
revision = '041d9a0f1159'
down_revision = '04c625aa95ba'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

2
magnum/db/sqlalchemy/alembic/versions/049f81f6f584_remove_ssh_authorized_key_from_baymodel.py

@ -25,7 +25,7 @@ Create Date: 2016-02-28 15:27:26.211244
revision = '049f81f6f584'
down_revision = 'ee92b41b8809'
from alembic import op
from alembic import op # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/04c625aa95ba_change_storage_driver_to_string.py

@ -21,8 +21,8 @@ Create Date: 2017-10-10 15:40:37.553288
revision = '04c625aa95ba'
down_revision = '52bcaf58fecb'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

8
magnum/db/sqlalchemy/alembic/versions/05d3e97de9ee_add_volume_driver.py

@ -22,13 +22,13 @@ Create Date: 2016-01-12 06:21:24.880838
revision = '05d3e97de9ee'
down_revision = '57fbdf2327a2'
from alembic import op
from alembic import op # noqa: E402
from oslo_db.sqlalchemy.types import String
from oslo_db.sqlalchemy.types import String # noqa: E402
import sqlalchemy as sa
import sqlalchemy as sa # noqa: E402
from sqlalchemy.dialects.mysql import TINYTEXT
from sqlalchemy.dialects.mysql import TINYTEXT # noqa: E402
def upgrade():

2
magnum/db/sqlalchemy/alembic/versions/085e601a39f6_remove_service.py

@ -21,7 +21,7 @@ Create Date: 2016-05-25 12:05:30.790282
revision = '085e601a39f6'
down_revision = 'a1136d335540'
from alembic import op
from alembic import op # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/14328d6a57e3_add_master_count_to_bay.py

@ -23,8 +23,8 @@ Create Date: 2015-07-29 16:00:38.721016
revision = '14328d6a57e3'
down_revision = '53882537ac57'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/1481f5b560dd_add_labels_column_to_baymodel_table.py

@ -21,8 +21,8 @@ Create Date: 2015-09-02 22:34:07.590142
revision = '1481f5b560dd'
down_revision = '3be65537a94a'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/156ceb17fb0a_add_bay_status_reason.py

@ -21,8 +21,8 @@ Create Date: 2015-05-30 11:34:57.847071
revision = '156ceb17fb0a'
down_revision = '59e7664a8ba1'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/1afee1db6cd0_add_master_flavor.py

@ -21,8 +21,8 @@ Create Date: 2015-02-27 14:53:38.042900
revision = '1afee1db6cd0'
down_revision = '35cff7c86221'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/1c1ff5e56048_rename_container_image_id.py

@ -21,8 +21,8 @@ Create Date: 2015-06-18 10:21:40.991734
revision = '1c1ff5e56048'
down_revision = '156ceb17fb0a'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/1d045384b966_add_insecure_baymodel_attr.py

@ -21,8 +21,8 @@ Create Date: 2015-09-23 18:17:10.195121
revision = '1d045384b966'
down_revision = '1481f5b560dd'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

2
magnum/db/sqlalchemy/alembic/versions/1f196a3dabae_remove_container.py

@ -21,7 +21,7 @@ Create Date: 2016-06-02 11:42:42.200992
revision = '1f196a3dabae'
down_revision = 'e0653b2d5271'
from alembic import op
from alembic import op # noqa: E402
def upgrade():

8
magnum/db/sqlalchemy/alembic/versions/2581ebaf0cb2_initial_migration.py

@ -23,13 +23,13 @@ Create Date: 2014-01-17 12:14:07.754448
revision = '2581ebaf0cb2'
down_revision = None
from alembic import op
from alembic import op # noqa: E402
from oslo_db.sqlalchemy.types import String
from oslo_db.sqlalchemy.types import String # noqa: E402
import sqlalchemy as sa
import sqlalchemy as sa # noqa: E402
from sqlalchemy.dialects.mysql import TINYTEXT
from sqlalchemy.dialects.mysql import TINYTEXT # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/27ad304554e2_adding_magnum_service_functionality.py

@ -22,8 +22,8 @@ Create Date: 2015-09-01 18:27:14.371860
revision = '27ad304554e2'
down_revision = '1d045384b966'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/29affeaa2bc2_rename_bay_master_address.py

@ -21,8 +21,8 @@ Create Date: 2015-03-25 16:06:08.148629
revision = '29affeaa2bc2'
down_revision = '2d1354bbf76e'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/2ace4006498_rename_bay_minions_address.py

@ -21,9 +21,9 @@ Create Date: 2015-03-27 15:15:36.309601
revision = '2ace4006498'
down_revision = '29affeaa2bc2'
from alembic import op
from alembic import op # noqa: E402
from magnum.db.sqlalchemy import models
from magnum.db.sqlalchemy import models # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/2ae93c9c6191_add_public_column_to_baymodel_table.py

@ -24,8 +24,8 @@ Create Date: 2015-09-30 15:33:44.514290
revision = '2ae93c9c6191'
down_revision = '5ad410481b88'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/2b5f24dd95de_rename_service_port.py

@ -21,9 +21,9 @@ Create Date: 2015-04-29 05:52:52.204095
revision = '2b5f24dd95de'
down_revision = '3b6c4c42adb4'
from alembic import op
from alembic import op # noqa: E402
from magnum.db.sqlalchemy import models
from magnum.db.sqlalchemy import models # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/2d1354bbf76e_ssh_authorized_key.py

@ -25,8 +25,8 @@ Create Date: 2015-03-13 14:05:58.744652
revision = '2d1354bbf76e'
down_revision = '1afee1db6cd0'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/2d8657c0cdc_add_bay_uuid.py

@ -22,8 +22,8 @@ Create Date: 2015-04-22 16:59:06.799384
revision = '2d8657c0cdc'
down_revision = 'e772b2598d9'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/33ef79969018_add_memory_to_container.py

@ -24,8 +24,8 @@ Create Date: 2015-10-03 17:03:47.194253
revision = '33ef79969018'
down_revision = '2ae93c9c6191'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

8
magnum/db/sqlalchemy/alembic/versions/35cff7c86221_add_private_network_to_baymodel.py

@ -23,13 +23,13 @@ Create Date: 2015-02-26 05:02:34.260099
revision = '35cff7c86221'
down_revision = '3a938526b35d'
from alembic import op
from alembic import op # noqa: E402
from oslo_db.sqlalchemy.types import String
from oslo_db.sqlalchemy.types import String # noqa: E402
import sqlalchemy as sa
import sqlalchemy as sa # noqa: E402
from sqlalchemy.dialects.mysql import TINYTEXT
from sqlalchemy.dialects.mysql import TINYTEXT # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/3a938526b35d_add_docker_volume_size.py

@ -25,8 +25,8 @@ Create Date: 2015-02-23 14:32:00.086650
revision = '3a938526b35d'
down_revision = '5793cd26898d'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

2
magnum/db/sqlalchemy/alembic/versions/3b6c4c42adb4_add_unique_constraints.py

@ -22,7 +22,7 @@ Create Date: 2015-05-05 09:45:44.657047
revision = '3b6c4c42adb4'
down_revision = '592131657ca1'
from alembic import op
from alembic import op # noqa: E402
def upgrade():

8
magnum/db/sqlalchemy/alembic/versions/3be65537a94a_add_network_driver_baymodel_column.py

@ -25,13 +25,13 @@ Create Date: 2015-09-03 20:51:54.229436
revision = '3be65537a94a'
down_revision = '4e263f236334'
from alembic import op
from alembic import op # noqa: E402
from oslo_db.sqlalchemy.types import String
from oslo_db.sqlalchemy.types import String # noqa: E402
import sqlalchemy as sa
import sqlalchemy as sa # noqa: E402
from sqlalchemy.dialects.mysql import TINYTEXT
from sqlalchemy.dialects.mysql import TINYTEXT # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/3bea56f25597_multi_tenant.py

@ -22,8 +22,8 @@ Create Date: 2015-01-22 22:22:22.150632
revision = '3bea56f25597'
down_revision = '2581ebaf0cb2'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/40f325033343_add_bay_create_timeout_to_bay.py

@ -22,8 +22,8 @@ Create Date: 2015-12-02 16:38:54.697413
revision = '40f325033343'
down_revision = '5977879072a7'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/417917e778f5_add_server_type_to_baymodel.py

@ -22,8 +22,8 @@ Create Date: 2015-10-14 16:21:57.229436
revision = '417917e778f5'
down_revision = '33ef79969018'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/421102d1f2d2_create_x509keypair_table.py

@ -24,8 +24,8 @@ Create Date: 2015-07-17 13:12:12.653241
revision = '421102d1f2d2'
down_revision = '14328d6a57e3'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/456126c6c9e9_create_baylock_table.py

@ -22,8 +22,8 @@ Create Date: 2015-04-01 15:04:45.652672
revision = '456126c6c9e9'
down_revision = '2ace4006498'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

12
magnum/db/sqlalchemy/alembic/versions/461d798132c7_change_cluster_to_support_nodegroups.py

@ -25,15 +25,15 @@ Create Date: 2019-02-06 14:32:40.316528
revision = '461d798132c7'
down_revision = 'ac92cbae311c'
from alembic import op
from alembic import op # noqa: E402
import sqlalchemy as sa
import sqlalchemy as sa # noqa: E402
from oslo_db.sqlalchemy.types import String
from oslo_serialization import jsonutils
from oslo_utils import uuidutils
from oslo_db.sqlalchemy.types import String # noqa: E402
from oslo_serialization import jsonutils # noqa: E402
from oslo_utils import uuidutils # noqa: E402
from magnum.db.sqlalchemy import models
from magnum.db.sqlalchemy import models # noqa: E402
def _handle_json_columns(value, default=None):

8
magnum/db/sqlalchemy/alembic/versions/47380964133d_add_network_subnet_fip_to_cluster.py

@ -22,10 +22,10 @@ Create Date: 2019-07-17 13:17:58.760452
revision = '47380964133d'
down_revision = '461d798132c7'
from alembic import op
from oslo_db.sqlalchemy.types import String
import sqlalchemy as sa
from sqlalchemy.dialects.mysql import TINYTEXT
from alembic import op # noqa: E402
from oslo_db.sqlalchemy.types import String # noqa: E402
import sqlalchemy as sa # noqa: E402
from sqlalchemy.dialects.mysql import TINYTEXT # noqa: E402
def upgrade():

8
magnum/db/sqlalchemy/alembic/versions/4956f03cabad_add_cluster_distro.py

@ -22,13 +22,13 @@ Create Date: 2015-04-25 02:17:51.486547
revision = '4956f03cabad'
down_revision = '2d8657c0cdc'
from alembic import op
from alembic import op # noqa: E402
from oslo_db.sqlalchemy.types import String
from oslo_db.sqlalchemy.types import String # noqa: E402
import sqlalchemy as sa
import sqlalchemy as sa # noqa: E402
from sqlalchemy.dialects.mysql import TINYTEXT
from sqlalchemy.dialects.mysql import TINYTEXT # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/4e263f236334_add_registry_enabled.py

@ -21,8 +21,8 @@ Create Date: 2015-09-14 18:39:25.871218
revision = '4e263f236334'
down_revision = '5518af8dbc21'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

8
magnum/db/sqlalchemy/alembic/versions/4ea34a59a64c_add_discovery_url_to_bay.py

@ -21,13 +21,13 @@ Create Date: 2015-04-14 18:56:03.440329
revision = '4ea34a59a64c'
down_revision = '456126c6c9e9'
from alembic import op
from alembic import op # noqa: E402
from oslo_db.sqlalchemy.types import String
from oslo_db.sqlalchemy.types import String # noqa: E402
import sqlalchemy as sa
import sqlalchemy as sa # noqa: E402
from sqlalchemy.dialects.mysql import TINYTEXT
from sqlalchemy.dialects.mysql import TINYTEXT # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/52bcaf58fecb_add_master_flavor_id_to_cluster.py

@ -21,8 +21,8 @@ Create Date: 2017-08-01 11:22:31.277745
revision = '52bcaf58fecb'
down_revision = 'a0e7c8450ab1'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/53882537ac57_add_host_column_to_pod.py

@ -23,8 +23,8 @@ Create Date: 2015-06-25 16:52:47.159887
revision = '53882537ac57'
down_revision = '1c1ff5e56048'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

8
magnum/db/sqlalchemy/alembic/versions/5518af8dbc21_rename_cert_uuid.py

@ -21,13 +21,13 @@ Create Date: 2015-08-28 13:13:19.747625
revision = '5518af8dbc21'
down_revision = '6f21dc920bb'
from alembic import op
from alembic import op # noqa: E402 # noqa: E402
from oslo_db.sqlalchemy.types import String
from oslo_db.sqlalchemy.types import String # noqa: E402
import sqlalchemy as sa
import sqlalchemy as sa # noqa: E402
from sqlalchemy.dialects.mysql import TEXT
from sqlalchemy.dialects.mysql import TEXT # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/5793cd26898d_add_bay_status.py

@ -21,8 +21,8 @@ Create Date: 2015-02-09 12:54:09.449948
revision = '5793cd26898d'
down_revision = '3bea56f25597'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

2
magnum/db/sqlalchemy/alembic/versions/57fbdf2327a2_remove_baylock.py

@ -22,7 +22,7 @@ Create Date: 2015-12-17 09:27:18.429773
revision = '57fbdf2327a2'
down_revision = 'adc3b7679ae'
from alembic import op
from alembic import op # noqa: E402
def upgrade():

10
magnum/db/sqlalchemy/alembic/versions/592131657ca1_add_coe_column_to_baymodel.py

@ -22,14 +22,14 @@ Create Date: 2015-04-17 14:20:17.620995
revision = '592131657ca1'
down_revision = '4956f03cabad'
from alembic import op
from alembic import op # noqa: E402
from oslo_db.sqlalchemy.types import String
from oslo_db.sqlalchemy.types import String # noqa: E402
import magnum.conf
import sqlalchemy as sa
import magnum.conf # noqa: E402
import sqlalchemy as sa # noqa: E402
from sqlalchemy.dialects.mysql import TINYTEXT
from sqlalchemy.dialects.mysql import TINYTEXT # noqa: E402
CONF = magnum.conf.CONF

4
magnum/db/sqlalchemy/alembic/versions/5977879072a7_add_env_to_container.py

@ -22,8 +22,8 @@ Create Date: 2015-11-26 04:10:39.462966
revision = '5977879072a7'
down_revision = '417917e778f5'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/59e7664a8ba1_add_container_status.py

@ -22,8 +22,8 @@ Create Date: 2015-05-11 11:33:23.125790
revision = '59e7664a8ba1'
down_revision = '2b5f24dd95de'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/5ad410481b88_rename_insecure.py

@ -21,8 +21,8 @@ Create Date: 2015-09-29 17:51:10.195121
revision = '5ad410481b88'
down_revision = '27ad304554e2'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

8
magnum/db/sqlalchemy/alembic/versions/5d4caa6e0a42_create_trustee_for_each_bay.py

@ -25,13 +25,13 @@ Create Date: 2016-02-17 14:16:12.927874
revision = '5d4caa6e0a42'
down_revision = 'bb42b7cad130'
from alembic import op
from alembic import op # noqa: E402
from oslo_db.sqlalchemy.types import String
from oslo_db.sqlalchemy.types import String # noqa: E402
import sqlalchemy as sa
import sqlalchemy as sa # noqa: E402
from sqlalchemy.dialects.mysql import TINYTEXT
from sqlalchemy.dialects.mysql import TINYTEXT # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/68ce16dfd341_add_master_lb_enabled_column_to_baymodel_table.py

@ -21,8 +21,8 @@ Create Date: 2016-06-23 18:44:55.312413
revision = '68ce16dfd341'
down_revision = '085e601a39f6'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/6f21dc920bb_add_cert_uuid_to_bay.py

@ -21,8 +21,8 @@ Create Date: 2015-08-19 13:57:14.863292
revision = '6f21dc920bb'
down_revision = '966a99e70ff'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

6
magnum/db/sqlalchemy/alembic/versions/6f21dc998bb_add_master_addresses_to_bay.py

@ -22,9 +22,9 @@ Create Date: 2015-08-20 13:57:14.863292
revision = '6f21dc998bb'
down_revision = '421102d1f2d2'
from alembic import op
from magnum.db.sqlalchemy import models
import sqlalchemy as sa
from alembic import op # noqa: E402
from magnum.db.sqlalchemy import models # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/720f640f43d1_rename_bay_table_to_cluster.py

@ -21,8 +21,8 @@ Create Date: 2016-09-02 09:43:41.485934
revision = '720f640f43d1'
down_revision = 'fb03fdef8919'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

2
magnum/db/sqlalchemy/alembic/versions/859fb45df249_remove_replication_controller.py

@ -21,7 +21,7 @@ Create Date: 2016-08-09 13:46:24.052528
revision = '859fb45df249'
down_revision = '1f196a3dabae'
from alembic import op
from alembic import op # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/87e62e3c7abc_add_hidden_to_cluster_template.py

@ -21,8 +21,8 @@ Create Date: 2019-02-05 15:35:26.290751
revision = '87e62e3c7abc'
down_revision = 'cbbc65a86986'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

8
magnum/db/sqlalchemy/alembic/versions/966a99e70ff_add_proxy.py

@ -21,13 +21,13 @@ Create Date: 2015-08-24 11:23:24.262921
revision = '966a99e70ff'
down_revision = '6f21dc998bb'
from alembic import op
from alembic import op # noqa: E402
from oslo_db.sqlalchemy.types import String
from oslo_db.sqlalchemy.types import String # noqa: E402
import sqlalchemy as sa
import sqlalchemy as sa # noqa: E402 # noqa: E402
from sqlalchemy.dialects.mysql import TINYTEXT
from sqlalchemy.dialects.mysql import TINYTEXT # noqa: E402
def upgrade():

6
magnum/db/sqlalchemy/alembic/versions/9a1539f1cd2c_add_federation_table.py

@ -22,10 +22,10 @@ Create Date: 2017-08-07 11:47:29.865166
revision = '9a1539f1cd2c'
down_revision = '041d9a0f1159'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
from magnum.db.sqlalchemy import models
from magnum.db.sqlalchemy import models # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/a0e7c8450ab1_add_labels_to_cluster.py

@ -21,8 +21,8 @@ Create Date: 2017-06-12 10:08:05.501441
revision = 'a0e7c8450ab1'
down_revision = 'aa0cc27839af'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/a1136d335540_add_docker_storage_driver_column.py

@ -21,8 +21,8 @@ Create Date: 2016-03-07 19:00:28.738486
revision = 'a1136d335540'
down_revision = 'd072f58ab240'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
docker_storage_driver_enum = sa.Enum('devicemapper', 'overlay',

4
magnum/db/sqlalchemy/alembic/versions/aa0cc27839af_add_docker_volume_size_to_cluster.py

@ -21,8 +21,8 @@ Create Date: 2017-06-07 13:08:02.853105
revision = 'aa0cc27839af'
down_revision = 'bc46ba6cf949'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

8
magnum/db/sqlalchemy/alembic/versions/ac92cbae311c_add_nodegoup_table.py

@ -25,13 +25,13 @@ Create Date: 2018-09-20 15:26:00.869885
revision = 'ac92cbae311c'
down_revision = '87e62e3c7abc'
from alembic import op
from alembic import op # noqa: E402
import sqlalchemy as sa
import sqlalchemy as sa # noqa: E402
from oslo_db.sqlalchemy.types import String
from oslo_db.sqlalchemy.types import String # noqa: E402
from magnum.db.sqlalchemy import models
from magnum.db.sqlalchemy import models # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/adc3b7679ae_add_registry_trust_id_to_bay.py

@ -22,8 +22,8 @@ Create Date: 2015-12-07 15:49:07.622122
revision = 'adc3b7679ae'
down_revision = '40f325033343'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/b1f612248cab_add_floating_ip_enabled_column_to_.py

@ -21,8 +21,8 @@ Create Date: 2016-08-05 15:31:46.203266
revision = 'b1f612248cab'
down_revision = '859fb45df249'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

2
magnum/db/sqlalchemy/alembic/versions/bb42b7cad130_remove_node_object.py

@ -22,7 +22,7 @@ Create Date: 2016-02-02 16:04:36.501547
revision = 'bb42b7cad130'
down_revision = '05d3e97de9ee'
from alembic import op
from alembic import op # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/bc46ba6cf949_add_keypair_to_cluster.py

@ -23,8 +23,8 @@ Create Date: 2016-10-03 10:47:08.584635
revision = 'bc46ba6cf949'
down_revision = '720f640f43d1'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

6
magnum/db/sqlalchemy/alembic/versions/c04e925e65c2_nodegroups_v2.py

@ -25,11 +25,11 @@ Create Date: 2019-06-14 09:29:58.288671
revision = 'c04e925e65c2'
down_revision = '47380964133d'
from alembic import op
from alembic import op # noqa: E402
import sqlalchemy as sa
import sqlalchemy as sa # noqa: E402
from oslo_db.sqlalchemy.types import String
from oslo_db.sqlalchemy.types import String # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/cbbc65a86986_add_health_status_to_cluster.py

@ -23,8 +23,8 @@ Create Date: 2018-05-15 22:24:49.527558
revision = 'cbbc65a86986'
down_revision = '9a1539f1cd2c'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/d072f58ab240_modify_x509keypair_table.py

@ -25,8 +25,8 @@ Create Date: 2016-05-27 15:29:22.955268
revision = 'd072f58ab240'
down_revision = 'ef08a5e057bd'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

8
magnum/db/sqlalchemy/alembic/versions/e0653b2d5271_add_fixed_subnet_column_to_baymodel_table.py

@ -21,13 +21,13 @@ Create Date: 2016-06-29 14:14:37.862594
revision = 'e0653b2d5271'
down_revision = '68ce16dfd341'
from alembic import op
from alembic import op # noqa: E402
from oslo_db.sqlalchemy.types import String
from oslo_db.sqlalchemy.types import String # noqa: E402
import sqlalchemy as sa
import sqlalchemy as sa # noqa: E402
from sqlalchemy.dialects.mysql import TINYTEXT
from sqlalchemy.dialects.mysql import TINYTEXT # noqa: E402
def upgrade():

8
magnum/db/sqlalchemy/alembic/versions/e647f5931da8_add_insecure_registry_to_baymodel.py

@ -21,13 +21,13 @@ Create Date: 2016-03-28 09:08:07.467102
revision = 'e647f5931da8'
down_revision = '049f81f6f584'
from alembic import op
from alembic import op # noqa: E402
from oslo_db.sqlalchemy.types import String
from oslo_db.sqlalchemy.types import String # noqa: E402
import sqlalchemy as sa
import sqlalchemy as sa # noqa: E402
from sqlalchemy.dialects.mysql import TINYTEXT
from sqlalchemy.dialects.mysql import TINYTEXT # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/e772b2598d9_add_container_command.py

@ -21,8 +21,8 @@ Create Date: 2015-04-17 18:59:52.770329
revision = 'e772b2598d9'
down_revision = '4ea34a59a64c'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

4
magnum/db/sqlalchemy/alembic/versions/ee92b41b8809_create_quotas_table.py

@ -24,8 +24,8 @@ Create Date: 2016-02-26 18:32:08.992964
revision = 'ee92b41b8809'
down_revision = '5d4caa6e0a42'
from alembic import op
import sqlalchemy as sa
from alembic import op # noqa: E402
import sqlalchemy as sa # noqa: E402
def upgrade():

2
magnum/db/sqlalchemy/alembic/versions/ef08a5e057bd_remove_pod.py

@ -21,7 +21,7 @@ Create Date: 2016-05-24 13:52:39.782156
revision = 'ef08a5e057bd'
down_revision = 'e647f5931da8'
from alembic import op
from alembic import op # noqa: E402
def upgrade():

2
magnum/db/sqlalchemy/alembic/versions/fb03fdef8919_rename_baymodel_to_clustertemplate.py

@ -21,7 +21,7 @@ Create Date: 2016-08-31 12:40:31.165817
revision = 'fb03fdef8919'
down_revision = 'fcb4efee8f8b'
from alembic import op
from alembic import op # noqa: E402
def upgrade():

8
magnum/db/sqlalchemy/alembic/versions/fcb4efee8f8b_add_version_info_to_bay.py

@ -21,13 +21,13 @@ Create Date: 2016-08-22 15:04:32.256811
revision = 'fcb4efee8f8b'
down_revision = 'b1f612248cab'
from alembic import op
from alembic import op # noqa: E402
from oslo_db.sqlalchemy.types import String
from oslo_db.sqlalchemy.types import String # noqa: E402
import sqlalchemy as sa
import sqlalchemy as sa # noqa: E402
from sqlalchemy.dialects.mysql import TINYTEXT
from sqlalchemy.dialects.mysql import TINYTEXT # noqa: E402
def upgrade():

1
magnum/db/sqlalchemy/models.py

@ -98,6 +98,7 @@ class MagnumBase(models.TimestampMixin,
super(MagnumBase, self).save(session)
Base = declarative_base(cls=MagnumBase)

2
magnum/drivers/heat/driver.py

@ -366,7 +366,7 @@ class FedoraKubernetesDriver(KubernetesDriver):
new_labels.update({'kube_tag': new_kube_tag})
return new_labels
def upgrade_cluster(self, context, cluster, cluster_template,
def upgrade_cluster(self, context, cluster, cluster_template, # noqa: C901
max_batch_size, nodegroup, scale_manager=None,
rollback=False):
osc = clients.OpenStackClients(context)

27
magnum/hacking/checks.py

@ -15,7 +15,7 @@
import re
import pep8 # noqa
from hacking import core
"""
Guidelines for writing new hacking checks
@ -42,7 +42,7 @@ assert_equal_with_is_not_none_re = re.compile(
r"assertEqual\(.*?\s+is+\s+not+\s+None\)$")
assert_true_isinstance_re = re.compile(
r"(.)*assertTrue\(isinstance\((\w|\.|\'|\"|\[|\])+, "
"(\w|\.|\'|\"|\[|\])+\)\)")
r"(\w|\.|\'|\"|\[|\])+\)\)")
dict_constructor_with_list_copy_re = re.compile(r".*\bdict\((\[)?(\(|\[)")
assert_xrange_re = re.compile(
r"\s*xrange\s*\(")
@ -58,16 +58,18 @@ custom_underscore_check = re.compile(r"(.)*_\s*=\s*(.)*")
underscore_import_check = re.compile(r"(.)*import _(.)*")
translated_log = re.compile(
r"(.)*LOG\.(audit|error|info|critical|exception)"
"\(\s*_\(\s*('|\")")
r"\(\s*_\(\s*('|\")")
string_translation = re.compile(r"[^_]*_\(\s*('|\")")
@core.flake8ext
def no_mutable_default_args(logical_line):
msg = "M322: Method's default argument shouldn't be mutable!"
if mutable_default_args.match(logical_line):
yield (0, msg)
@core.flake8ext
def assert_equal_not_none(logical_line):
"""Check for assertEqual(A is not None) sentences M302"""
msg = "M302: assertEqual(A is not None) sentences not allowed."
@ -76,6 +78,7 @@ def assert_equal_not_none(logical_line):
yield (0, msg)
@core.flake8ext
def assert_true_isinstance(logical_line):
"""Check for assertTrue(isinstance(a, b)) sentences
@ -85,6 +88,7 @@ def assert_true_isinstance(logical_line):
yield (0, "M316: assertTrue(isinstance(a, b)) sentences not allowed")
@core.flake8ext
def assert_equal_in(logical_line):
"""Check for assertEqual(True|False, A in B), assertEqual(A in B, True|False)
@ -98,6 +102,7 @@ def assert_equal_in(logical_line):