Fix some pep8 errors, update tox.ini

Fixed E731, W503 and I201 pep8 errors.

Added flake8-import-order to test-requirements.txt to avoid
an "unknown option 'import-order-style' ignored" warning.

Removed {posargs} from flake8 invocation so it can be called
such as 'tox -e pep8 HEAD~1' in order to only run on files
changed in the top commit.

Removed py34, py27 and pypy from the tox.ini envlist since
there are no unit tests, and tox reports it skipped all tests.

Change-Id: I574cafe074befa59aaee44b092b011e27f5f4211
diff --git a/neutron_tempest_plugin/api/test_dhcp_ipv6.py b/neutron_tempest_plugin/api/test_dhcp_ipv6.py
index 69b4ea0..0fab75c 100644
--- a/neutron_tempest_plugin/api/test_dhcp_ipv6.py
+++ b/neutron_tempest_plugin/api/test_dhcp_ipv6.py
@@ -58,8 +58,8 @@
         ports = body['ports']
         for port in ports:
             if (port['device_owner'].startswith(
-                    constants.DEVICE_OWNER_ROUTER_INTF)
-                and port['device_id'] in [r['id'] for r in self.routers]):
+                    constants.DEVICE_OWNER_ROUTER_INTF) and
+                port['device_id'] in [r['id'] for r in self.routers]):
                 self.client.remove_router_interface_with_port_id(
                     port['device_id'], port['id']
                 )
diff --git a/neutron_tempest_plugin/api/test_network_ip_availability.py b/neutron_tempest_plugin/api/test_network_ip_availability.py
index ed56363..10aee2e 100644
--- a/neutron_tempest_plugin/api/test_network_ip_availability.py
+++ b/neutron_tempest_plugin/api/test_network_ip_availability.py
@@ -79,11 +79,11 @@
 def calc_total_ips(prefix, ip_version):
     # will calculate total ips after removing reserved.
     if ip_version == lib_constants.IP_VERSION_4:
-        total_ips = 2 ** (lib_constants.IPv4_BITS
-                          - prefix) - DEFAULT_IP4_RESERVED
+        total_ips = 2 ** (lib_constants.IPv4_BITS -
+                          prefix) - DEFAULT_IP4_RESERVED
     elif ip_version == lib_constants.IP_VERSION_6:
-        total_ips = 2 ** (lib_constants.IPv6_BITS
-                          - prefix) - DEFAULT_IP6_RESERVED
+        total_ips = 2 ** (lib_constants.IPv6_BITS -
+                          prefix) - DEFAULT_IP6_RESERVED
     return total_ips
 
 
diff --git a/neutron_tempest_plugin/api/test_routers.py b/neutron_tempest_plugin/api/test_routers.py
index bc657e0..d5d2e04 100644
--- a/neutron_tempest_plugin/api/test_routers.py
+++ b/neutron_tempest_plugin/api/test_routers.py
@@ -159,9 +159,12 @@
         # Add router interface with subnet id
         router = self._create_router(data_utils.rand_name('router'), True)
         intf = self.create_router_interface(router['id'], subnet['id'])
-        status_active = lambda: self.client.show_port(
-            intf['port_id'])['port']['status'] == 'ACTIVE'
-        utils.wait_until_true(status_active, exception=AssertionError)
+
+        def _status_active():
+            return self.client.show_port(
+                intf['port_id'])['port']['status'] == 'ACTIVE'
+
+        utils.wait_until_true(_status_active, exception=AssertionError)
 
     @decorators.idempotent_id('c86ac3a8-50bd-4b00-a6b8-62af84a0765c')
     @tutils.requires_ext(extension='extraroute', service='network')