diff --git a/ansible/library/kolla_toolbox.py b/ansible/library/kolla_toolbox.py
index 276661df29263311766ce6cfe42712aaebca3c1a..c860c33bc9c42655c3b0a1070de2b6f7eaa86cb8 100644
--- a/ansible/library/kolla_toolbox.py
+++ b/ansible/library/kolla_toolbox.py
@@ -96,10 +96,10 @@ EXAMPLES = '''
 '''
 
 
-JSON_REG = re.compile('^(?P<host>\w+) \| (?P<status>\w+)!? =>(?P<stdout>.*)$',
+JSON_REG = re.compile(r'^(?P<host>\w+) \| (?P<status>\w+)!? =>(?P<stdout>.*)$',
                       re.MULTILINE | re.DOTALL)
-NON_JSON_REG = re.compile(('^(?P<host>\w+) \| (?P<status>\w+)!? \| '
-                           'rc=(?P<exit_code>\d+) >>\n(?P<stdout>.*)\n$'),
+NON_JSON_REG = re.compile((r'^(?P<host>\w+) \| (?P<status>\w+)!? \| '
+                           r'rc=(?P<exit_code>\d+) >>\n(?P<stdout>.*)\n$'),
                           re.MULTILINE | re.DOTALL)
 
 
@@ -172,7 +172,7 @@ def main():
 
         try:
             output = json.loads(json_output)
-        except Exception as e:
+        except Exception:
             module.fail_json(
                 msg='Can not parse the inner module output: %s' % json_output)
 
@@ -194,7 +194,7 @@ def main():
         # }
         try:
             ret = output['plays'][0]['tasks'][0]['hosts']['localhost']
-        except (KeyError, IndexError) as e:
+        except (KeyError, IndexError):
             module.fail_json(
                 msg='Ansible JSON output has unexpected format: %s' % output)
 
diff --git a/kolla_ansible/tests/unit/test_address_filters.py b/kolla_ansible/tests/unit/test_address_filters.py
index 5f157ab9bc4925c7b6179c5db66a00d0b832ffbb..de2aadfe655be902a294d1f067ef10bb5eaeb680 100644
--- a/kolla_ansible/tests/unit/test_address_filters.py
+++ b/kolla_ansible/tests/unit/test_address_filters.py
@@ -143,12 +143,12 @@ class TestKollaAddressFilter(unittest.TestCase):
                                 'prefix': 64,
                             },
                             {
-                                'address': addr+'1',
+                                'address': addr + '1',
                                 'scope': 'link',
                                 'prefix': 64,
                             },
                             {
-                                'address': addr+'2',
+                                'address': addr + '2',
                                 'scope': 'global',
                                 'prefix': 64,
                             },
@@ -175,7 +175,7 @@ class TestKollaAddressFilter(unittest.TestCase):
                                 'prefix': 64,
                             },
                             {
-                                'address': addr+'1',
+                                'address': addr + '1',
                                 'scope': 'link',
                                 'prefix': 64,
                             },
diff --git a/kolla_ansible/tests/unit/test_filters.py b/kolla_ansible/tests/unit/test_filters.py
index 2ae334ce37fc061dbb628461e16d829d2d82d9fe..e35f503d97ecf32253a10f80f3e079cdabba3b51 100644
--- a/kolla_ansible/tests/unit/test_filters.py
+++ b/kolla_ansible/tests/unit/test_filters.py
@@ -122,7 +122,7 @@ class TestFilters(unittest.TestCase):
 
     @mock.patch.object(filters, 'service_enabled')
     @mock.patch.object(filters, 'service_mapped_to_host')
-    def test_service_enabled_and_mapped_to_host(self,  mock_mapped,
+    def test_service_enabled_and_mapped_to_host(self, mock_mapped,
                                                 mock_enabled):
         service = {}
         mock_enabled.return_value = True
@@ -134,7 +134,7 @@ class TestFilters(unittest.TestCase):
 
     @mock.patch.object(filters, 'service_enabled')
     @mock.patch.object(filters, 'service_mapped_to_host')
-    def test_service_enabled_and_mapped_to_host_disabled(self,  mock_mapped,
+    def test_service_enabled_and_mapped_to_host_disabled(self, mock_mapped,
                                                          mock_enabled):
         service = {}
         mock_enabled.return_value = False
@@ -146,7 +146,7 @@ class TestFilters(unittest.TestCase):
 
     @mock.patch.object(filters, 'service_enabled')
     @mock.patch.object(filters, 'service_mapped_to_host')
-    def test_service_enabled_and_mapped_to_host_not_mapped(self,  mock_mapped,
+    def test_service_enabled_and_mapped_to_host_not_mapped(self, mock_mapped,
                                                            mock_enabled):
         service = {}
         mock_enabled.return_value = True
diff --git a/lower-constraints.txt b/lower-constraints.txt
index a714d26beba50a17adcf5cb403648c540e4e7f28..13855e307c3e9d3571763d2e68360cc84dc94252 100644
--- a/lower-constraints.txt
+++ b/lower-constraints.txt
@@ -23,10 +23,8 @@ dogpile.cache==0.6.5
 dulwich==0.19.0
 extras==1.0.0
 fixtures==3.0.0
-flake8==2.5.5
 gitdb2==2.0.3
 GitPython==2.1.8
-hacking==1.1.0
 idna==2.6
 imagesize==1.0.0
 iso8601==0.1.12
@@ -38,7 +36,6 @@ jsonschema==2.6.0
 keystoneauth1==3.4.0
 linecache2==1.0.0
 MarkupSafe==1.0
-mccabe==0.2.1
 monotonic==1.4
 mox3==0.25.0
 msgpack==0.5.6
@@ -61,7 +58,6 @@ packaging==17.1
 pbr==2.0.0
 prettytable==0.7.1
 pycparser==2.18
-pyflakes==0.8.1
 Pygments==2.2.0
 pyinotify==0.9.6
 pyOpenSSL==17.5.0
diff --git a/test-requirements.txt b/test-requirements.txt
index 7044225bd9cc8b40d89cf69adfa518f1f7d33948..9e9aeb5c29c8814f18c3fe4d24e0202458bb742d 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -7,7 +7,7 @@ beautifulsoup4>=4.6.0 # MIT
 coverage!=4.4,>=4.0 # Apache-2.0
 doc8>=0.6.0 # Apache-2.0
 extras>=1.0.0 # MIT
-hacking>=1.1.0,<1.2.0 # Apache-2.0
+hacking>=3.0,<3.1.0 # Apache-2.0
 oslo.log>=3.36.0 # Apache-2.0
 oslotest>=3.2.0 # Apache-2.0
 PrettyTable<0.8,>=0.7.1 # BSD
diff --git a/tests/test_kolla_docker.py b/tests/test_kolla_docker.py
index af00bc89f5d895cee6fb0cedf39ab8c1a42a5844..b2b9cca3d9cfd9b1b4bf7aa2cfc2d3665c314757 100644
--- a/tests/test_kolla_docker.py
+++ b/tests/test_kolla_docker.py
@@ -96,7 +96,7 @@ class ModuleArgsTest(base.BaseTestCase):
             dimensions=dict(required=False, type='dict', default=dict()),
             tty=dict(required=False, type='bool', default=False),
             client_timeout=dict(required=False, type='int', default=120),
-            )
+        )
         required_if = [
             ['action', 'pull_image', ['image']],
             ['action', 'start_container', ['image', 'name']],
diff --git a/tools/validate-all-file.py b/tools/validate-all-file.py
index 21e5bef841ca089cfb57e5a941f7a5962d6ba495..22a2d8be30a1f30c2c5224d40a3580c9adbd1e31 100755
--- a/tools/validate-all-file.py
+++ b/tools/validate-all-file.py
@@ -196,5 +196,6 @@ def main():
     )
     return sum([check() for check in checks])
 
+
 if __name__ == "__main__":
     sys.exit(main())
diff --git a/tools/validate-yaml.py b/tools/validate-yaml.py
index 43156313e5984562e4b59f08f6f69de89e452d9b..a69afe06fbbeb9d3a8cb3b862b151cb4334356c1 100755
--- a/tools/validate-yaml.py
+++ b/tools/validate-yaml.py
@@ -40,5 +40,6 @@ def main():
 
     sys.exit(res)
 
+
 if __name__ == '__main__':
     main()
diff --git a/tox.ini b/tox.ini
index 328575904cdfeac4ab555b1393f1c2473253a16e..d0f327fb06fdac105cba531c6f09a1e8d88c1f62 100644
--- a/tox.ini
+++ b/tox.ini
@@ -98,6 +98,11 @@ commands =
 
 [flake8]
 show-source = True
+# NOTE: Default ignore list is *not* empty!
+# TODO: Enable either W503 or W504:
+# W503 line break before binary operator
+# W504 line break after binary operator
+ignore = W503,W504
 exclude=.eggs,.git,.tox,doc
 
 [testenv:lower-constraints]