Update hacking for Python3

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

Fix:
E402 module level import not at top of file
E117 over-indented

Blacklist:
W504 line break after binary operator
E731 do not assign a lambda expression, use a def

Change-Id: I501dafd6fe238a99f394a427d456317517292aa5
This commit is contained in:
Andreas Jaeger 2020-03-28 08:29:55 +01:00 committed by Andreas Jaeger
parent 4735fbbb4f
commit 69f98e0fb8
6 changed files with 23 additions and 17 deletions

View File

@ -31,6 +31,12 @@ import six.moves.http_client as httplib
import oslo_i18n
from six.moves.urllib.parse import urlparse
from heat_cfnclient.version import version_info as version
from heat_cfnclient.common import exception
from heat_cfnclient import utils
from keystoneclient.v2_0 import client
# If ../heat_cfnclient/__init__.py exists, add ../ to Python search path, so
# that it will override what happens to be installed in $prefix/lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
@ -48,10 +54,6 @@ if scriptname == 'heat-boto':
from heat_cfnclient import boto_client as heat_client
else:
from heat_cfnclient import client as heat_client
from heat_cfnclient.version import version_info as version
from heat_cfnclient.common import exception
from heat_cfnclient import utils
from keystoneclient.v2_0 import client
def get_swift_template(options):

View File

@ -29,6 +29,11 @@ import logging
import oslo_i18n
from heat_cfnclient import boto_client_cloudwatch as heat_client
from heat_cfnclient.version import version_info as version
from heat_cfnclient.common import exception
from heat_cfnclient import utils
# If ../heat/__init__.py exists, add ../ to Python search path, so that
# it will override what happens to be installed in $prefix/lib/python...
possible_topdir = os.path.normpath(os.path.join(os.path.abspath(sys.argv[0]),
@ -42,10 +47,6 @@ scriptname = os.path.basename(sys.argv[0])
oslo_i18n.install('heat_cfnclient')
from heat_cfnclient import boto_client_cloudwatch as heat_client
from heat_cfnclient.version import version_info as version
from heat_cfnclient.common import exception
from heat_cfnclient import utils
DEFAULT_PORT = 8003

View File

@ -20,10 +20,11 @@ Client implementation based on the boto AWS client library
import sys
from oslo_log import log as logging
logger = logging.getLogger(__name__)
from boto import cloudformation
logger = logging.getLogger(__name__)
class BotoClient(cloudformation.CloudFormationConnection):
'''

View File

@ -21,10 +21,10 @@ import sys
from oslo_log import log as logging
logger = logging.getLogger(__name__)
from boto.ec2 import cloudwatch
logger = logging.getLogger(__name__)
class BotoCWClient(cloudwatch.CloudWatchConnection):
'''
@ -181,10 +181,10 @@ class BotoCWClient(cloudwatch.CloudWatchConnection):
ret = []
for m in metlist:
ret.append("MetricName : %s" % m.name)
ret.append("Namespace : %s" % m.namespace)
ret.append("Dimensions : %s" % m.dimensions)
ret.append("--")
ret.append("MetricName : %s" % m.name)
ret.append("Namespace : %s" % m.namespace)
ret.append("Dimensions : %s" % m.dimensions)
ret.append("--")
return '\n'.join(ret)

View File

@ -3,7 +3,7 @@
# process, which may cause wedges in the gate later.
# Hacking already pins down pep8, pyflakes and flake8
hacking>=0.10.2,<0.11
hacking>=3.0,<3.1.0 # Apache-2.0
coverage>=3.6
discover
mox>=0.5.3

View File

@ -35,7 +35,9 @@ commands =
# H306 imports not in alphabetical order
# H404 multi line docstring should start with a summary
# H405 multi line docstring summary not separated with an empty line
ignore = F841,H104,H201,H233,H302,H306,H404,H405
# W504 line break after binary operator
# E731 do not assign a lambda expression, use a def
ignore = F841,H104,H201,H233,H302,H306,H404,H405,W504,E731
show-source = true
builtins = _
exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,tools,build