Merge "Apply a naming rule of GET to secgroup clients"
diff --git a/tempest/api/compute/admin/test_security_group_default_rules.py b/tempest/api/compute/admin/test_security_group_default_rules.py
index c1fe18c..13d6cc0 100644
--- a/tempest/api/compute/admin/test_security_group_default_rules.py
+++ b/tempest/api/compute/admin/test_security_group_default_rules.py
@@ -64,7 +64,7 @@
# Delete Security Group default rule
self.adm_client.delete_security_group_default_rule(rule['id'])
self.assertRaises(lib_exc.NotFound,
- self.adm_client.get_security_group_default_rule,
+ self.adm_client.show_security_group_default_rule,
rule['id'])
@test.idempotent_id('4d752e0a-33a1-4c3a-b498-ff8667ca22e5')
@@ -125,6 +125,6 @@
cidr)
self.addCleanup(self.adm_client.delete_security_group_default_rule,
rule['id'])
- fetched_rule = self.adm_client.get_security_group_default_rule(
+ fetched_rule = self.adm_client.show_security_group_default_rule(
rule['id'])
self.assertEqual(rule, fetched_rule)
diff --git a/tempest/api/compute/security_groups/test_security_groups.py b/tempest/api/compute/security_groups/test_security_groups.py
index 0ce26a3..821065c 100644
--- a/tempest/api/compute/security_groups/test_security_groups.py
+++ b/tempest/api/compute/security_groups/test_security_groups.py
@@ -75,7 +75,7 @@
"not equal to the requested name")
# Now fetch the created Security Group by its 'id'
fetched_group = \
- self.client.get_security_group(securitygroup['id'])
+ self.client.show_security_group(securitygroup['id'])
self.assertEqual(securitygroup, fetched_group,
"The fetched Security Group is different "
"from the created Group")
@@ -141,6 +141,6 @@
description=s_new_des)
# get the security group
fetched_group = \
- self.client.get_security_group(securitygroup_id)
+ self.client.show_security_group(securitygroup_id)
self.assertEqual(s_new_name, fetched_group['name'])
self.assertEqual(s_new_des, fetched_group['description'])
diff --git a/tempest/api/compute/security_groups/test_security_groups_negative.py b/tempest/api/compute/security_groups/test_security_groups_negative.py
index 06e073d..27a6670 100644
--- a/tempest/api/compute/security_groups/test_security_groups_negative.py
+++ b/tempest/api/compute/security_groups/test_security_groups_negative.py
@@ -58,7 +58,7 @@
# Negative test:Should not be able to GET the details
# of non-existent Security Group
non_exist_id = self._generate_a_non_existent_security_group_id()
- self.assertRaises(lib_exc.NotFound, self.client.get_security_group,
+ self.assertRaises(lib_exc.NotFound, self.client.show_security_group,
non_exist_id)
@decorators.skip_because(bug="1161411",
diff --git a/tempest/api/compute/test_authorization.py b/tempest/api/compute/test_authorization.py
index af29425..4933ce2 100644
--- a/tempest/api/compute/test_authorization.py
+++ b/tempest/api/compute/test_authorization.py
@@ -271,7 +271,7 @@
def test_get_security_group_of_alt_account_fails(self):
# A GET request for another user's security group should fail
self.assertRaises(lib_exc.NotFound,
- self.alt_security_client.get_security_group,
+ self.alt_security_client.show_security_group,
self.security_group['id'])
@test.idempotent_id('155387a5-2bbc-4acf-ab06-698dae537ea5')
diff --git a/tempest/services/compute/json/security_group_default_rules_client.py b/tempest/services/compute/json/security_group_default_rules_client.py
index 3bf3263..6853c03 100644
--- a/tempest/services/compute/json/security_group_default_rules_client.py
+++ b/tempest/services/compute/json/security_group_default_rules_client.py
@@ -49,7 +49,7 @@
def delete_security_group_default_rule(self,
security_group_default_rule_id):
"""Deletes the provided Security Group default rule."""
- resp, body = self.delete('os-security-group-default-rules/%s' % str(
+ resp, body = self.delete('os-security-group-default-rules/%s' % (
security_group_default_rule_id))
self.validate_response(schema.delete_security_group_default_rule,
resp, body)
@@ -64,10 +64,10 @@
rules = body['security_group_default_rules']
return service_client.ResponseBodyList(resp, rules)
- def get_security_group_default_rule(self, security_group_default_rule_id):
+ def show_security_group_default_rule(self, security_group_default_rule_id):
"""Return the details of provided Security Group default rule."""
- resp, body = self.get('os-security-group-default-rules/%s' % str(
- security_group_default_rule_id))
+ resp, body = self.get('os-security-group-default-rules/%s' %
+ security_group_default_rule_id)
body = json.loads(body)
self.validate_response(schema.create_get_security_group_default_rule,
resp, body)
diff --git a/tempest/services/compute/json/security_groups_client.py b/tempest/services/compute/json/security_groups_client.py
index 2855e13..5f1656c 100644
--- a/tempest/services/compute/json/security_groups_client.py
+++ b/tempest/services/compute/json/security_groups_client.py
@@ -36,9 +36,9 @@
self.validate_response(schema.list_security_groups, resp, body)
return service_client.ResponseBodyList(resp, body['security_groups'])
- def get_security_group(self, security_group_id):
+ def show_security_group(self, security_group_id):
"""Get the details of a Security Group."""
- url = "os-security-groups/%s" % str(security_group_id)
+ url = "os-security-groups/%s" % security_group_id
resp, body = self.get(url)
body = json.loads(body)
self.validate_response(schema.get_security_group, resp, body)
@@ -74,7 +74,7 @@
if description:
post_body['description'] = description
post_body = json.dumps({'security_group': post_body})
- resp, body = self.put('os-security-groups/%s' % str(security_group_id),
+ resp, body = self.put('os-security-groups/%s' % security_group_id,
post_body)
body = json.loads(body)
self.validate_response(schema.update_security_group, resp, body)
@@ -83,7 +83,7 @@
def delete_security_group(self, security_group_id):
"""Deletes the provided Security Group."""
resp, body = self.delete(
- 'os-security-groups/%s' % str(security_group_id))
+ 'os-security-groups/%s' % security_group_id)
self.validate_response(schema.delete_security_group, resp, body)
return service_client.ResponseBody(resp, body)
@@ -117,7 +117,7 @@
def delete_security_group_rule(self, group_rule_id):
"""Deletes the provided Security Group rule."""
resp, body = self.delete('os-security-group-rules/%s' %
- str(group_rule_id))
+ group_rule_id)
self.validate_response(schema.delete_security_group_rule, resp, body)
return service_client.ResponseBody(resp, body)
@@ -133,7 +133,7 @@
def is_resource_deleted(self, id):
try:
- self.get_security_group(id)
+ self.show_security_group(id)
except lib_exc.NotFound:
return True
return False