Update hacking for Python3

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

Fix problems found.

Change-Id: I76d42ef91d3cfc133a6f7a4dfdf982e5fec0d443
diff --git a/manila_tempest_tests/services/share/json/shares_client.py b/manila_tempest_tests/services/share/json/shares_client.py
index 3481151..b2eabb4 100644
--- a/manila_tempest_tests/services/share/json/shares_client.py
+++ b/manila_tempest_tests/services/share/json/shares_client.py
@@ -467,9 +467,9 @@
             metadata = {}
         post_body = {"metadata": metadata}
         body = json.dumps(post_body)
-        if method is "post":
+        if method == "post":
             resp, metadata = self.post(uri, body)
-        if method is "put":
+        if method == "put":
             resp, metadata = self.put(uri, body)
         self.expected_success(200, resp.status)
         return self._parse_resp(metadata)
diff --git a/manila_tempest_tests/services/share/v2/json/shares_client.py b/manila_tempest_tests/services/share/v2/json/shares_client.py
index 3c1f5a4..b19872b 100644
--- a/manila_tempest_tests/services/share/v2/json/shares_client.py
+++ b/manila_tempest_tests/services/share/v2/json/shares_client.py
@@ -869,7 +869,6 @@
         self.expected_success(200, resp.status)
         return body
 
-
 ###############
 
     def list_availability_zones(self, url='availability-zones',
diff --git a/manila_tempest_tests/tests/api/base.py b/manila_tempest_tests/tests/api/base.py
index 89f2e92..22b1d72 100644
--- a/manila_tempest_tests/tests/api/base.py
+++ b/manila_tempest_tests/tests/api/base.py
@@ -980,7 +980,7 @@
                 res_id = res['id']
                 client = res["client"]
                 with handle_cleanup_exceptions():
-                    if res["type"] is "share":
+                    if res["type"] == "share":
                         cls.clear_share_replicas(res_id)
                         share_group_id = res.get('share_group_id')
                         if share_group_id:
@@ -989,35 +989,35 @@
                         else:
                             client.delete_share(res_id)
                         client.wait_for_resource_deletion(share_id=res_id)
-                    elif res["type"] is "snapshot":
+                    elif res["type"] == "snapshot":
                         client.delete_snapshot(res_id)
                         client.wait_for_resource_deletion(snapshot_id=res_id)
-                    elif (res["type"] is "share_network" and
+                    elif (res["type"] == "share_network" and
                             res_id != CONF.share.share_network_id):
                         client.delete_share_network(res_id)
                         client.wait_for_resource_deletion(sn_id=res_id)
-                    elif res["type"] is "security_service":
+                    elif res["type"] == "security_service":
                         client.delete_security_service(res_id)
                         client.wait_for_resource_deletion(ss_id=res_id)
-                    elif res["type"] is "share_type":
+                    elif res["type"] == "share_type":
                         client.delete_share_type(res_id)
                         client.wait_for_resource_deletion(st_id=res_id)
-                    elif res["type"] is "share_group":
+                    elif res["type"] == "share_group":
                         client.delete_share_group(res_id)
                         client.wait_for_resource_deletion(
                             share_group_id=res_id)
-                    elif res["type"] is "share_group_type":
+                    elif res["type"] == "share_group_type":
                         client.delete_share_group_type(res_id)
                         client.wait_for_resource_deletion(
                             share_group_type_id=res_id)
-                    elif res["type"] is "share_group_snapshot":
+                    elif res["type"] == "share_group_snapshot":
                         client.delete_share_group_snapshot(res_id)
                         client.wait_for_resource_deletion(
                             share_group_snapshot_id=res_id)
-                    elif res["type"] is "share_replica":
+                    elif res["type"] == "share_replica":
                         client.delete_share_replica(res_id)
                         client.wait_for_resource_deletion(replica_id=res_id)
-                    elif res["type"] is "share_network_subnet":
+                    elif res["type"] == "share_network_subnet":
                         sn_id = res["extra_params"]["share_network_id"]
                         client.delete_subnet(sn_id, res_id)
                         client.wait_for_resource_deletion(
diff --git a/manila_tempest_tests/tests/scenario/test_share_basic_ops.py b/manila_tempest_tests/tests/scenario/test_share_basic_ops.py
index b9b17da..3ead5df 100644
--- a/manila_tempest_tests/tests/scenario/test_share_basic_ops.py
+++ b/manila_tempest_tests/tests/scenario/test_share_basic_ops.py
@@ -187,8 +187,8 @@
 
         if (force_host_assisted and
                 not CONF.share.run_host_assisted_migration_tests):
-                raise self.skipException("Host-assisted migration tests are "
-                                         "disabled.")
+            raise self.skipException("Host-assisted migration tests are "
+                                     "disabled.")
         elif (not force_host_assisted and
               not CONF.share.run_driver_assisted_migration_tests):
             raise self.skipException("Driver-assisted migration tests are "
diff --git a/test-requirements.txt b/test-requirements.txt
index 337b82e..a1ec376 100644
--- a/test-requirements.txt
+++ b/test-requirements.txt
@@ -2,7 +2,7 @@
 # of appearance. Changing the order has an impact on the overall integration
 # process, which may cause wedges in the gate later.
 
-hacking<0.13,>=0.12.0 # Apache-2.0
+hacking>=3.0,<3.1.0 # Apache-2.0
 
 coverage!=4.4,>=4.0 # Apache-2.0
 python-subunit>=1.0.0 # Apache-2.0/BSD
diff --git a/tox.ini b/tox.ini
index 0218477..59764db 100644
--- a/tox.ini
+++ b/tox.ini
@@ -35,8 +35,9 @@
 
 [flake8]
 # E123, E125 skipped as they are invalid PEP-8.
-
+# W503 line break before binary operator
+# W504 line break after binary operator
 show-source = True
-ignore = E123,E125
+ignore = E123,E125,W503,W504
 builtins = _
 exclude=.venv,.git,.tox,dist,doc,*lib/python*,*egg,build