Enable H233: Python 3.x incompatible use of print operator

This commit removes H233 from ignored list and fixes corresponding code
to pass the check.

Change-Id: I5f842e74e5c05f421307e29c059d63b309f1d23d
This commit is contained in:
Kirill Zaitsev 2015-09-25 16:17:56 +03:00
parent d9aca7dd5a
commit 24cdb64a1e
3 changed files with 7 additions and 10 deletions

View File

@ -206,16 +206,16 @@ class Debug(Middleware):
@webob.dec.wsgify
def __call__(self, req):
print ("*" * 40) + " REQUEST ENVIRON"
print(("*" * 40) + " REQUEST ENVIRON")
for key, value in req.environ.items():
print(key, "=", value)
print
print("")
resp = req.get_response(self.application)
print ("*" * 40) + " RESPONSE HEADERS"
print(("*" * 40) + " RESPONSE HEADERS")
for (key, value) in resp.headers.iteritems():
print(key, "=", value)
print
print("")
resp.app_iter = self.print_generator(resp.app_iter)
@ -226,12 +226,12 @@ class Debug(Middleware):
"""Iterator that prints the contents of a wrapper string iterator
when iterated.
"""
print ("*" * 40) + " BODY"
print(("*" * 40) + " BODY")
for part in app_iter:
sys.stdout.write(part)
sys.stdout.flush()
yield part
print
print("")
class Router(object):

View File

@ -96,7 +96,6 @@ class TestCongressRules(unittest.TestCase):
rules = congress_rules.convert(model, package_loader,
tenant_id=TENANT_ID)
rules_str = ", \n".join(map(str, rules))
print rules_str
return rules_str
@ -224,7 +223,6 @@ class TestCongressRules(unittest.TestCase):
tenant_id = uuidutils.generate_uuid()
rules = congress_rules.convert(model, tenant_id=tenant_id)
rules_str = ", \n".join(map(str, rules))
print rules_str
self.assertTrue('murano:objects+("1", "{0}", "t1")'.format(tenant_id)
in rules_str)

View File

@ -39,10 +39,9 @@ commands = bash tools/lintstack.sh
commands = oslo-config-generator --config-file etc/oslo-config-generator/murano.conf
[flake8]
# H233 Python 3.x incompatible use of print operator
# H405 Multi line docstring summary not separated with an empty line
ignore = H233,H405
ignore = H405
show-source = true
builtins = _
exclude=.venv,.git,.tox,dist,doc,*openstack/common*,*lib/python*,*egg,tools