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 "