Fix fail logic for server of another tenant test
This commit removes the try, finally logic from
test_delete_a_server_of_another_tenant() If the create_server() call
failed then the delete in the finally block would still run. This
would cause the test to error out masking the real reason for the
failure. This commit corrects the behavior by removing the delete and
the try, finally from the test. The base class will properly handle
the cleanup of the created server on class tear down so this delete
wasn't even necessary.
Change-Id: I6ee7c74122b4c88416672e5f0d3f3fb2bd71ab69
diff --git a/tempest/api/compute/servers/test_servers_negative.py b/tempest/api/compute/servers/test_servers_negative.py
index af58b5f..703f143 100644
--- a/tempest/api/compute/servers/test_servers_negative.py
+++ b/tempest/api/compute/servers/test_servers_negative.py
@@ -221,13 +221,10 @@
@attr(type=['negative', 'gate'])
def test_delete_a_server_of_another_tenant(self):
# Delete a server that belongs to another tenant
- try:
- resp, server = self.create_server(wait_until='ACTIVE')
- self.assertRaises(exceptions.NotFound,
- self.alt_client.delete_server,
- server['id'])
- finally:
- self.client.delete_server(server['id'])
+ resp, server = self.create_server(wait_until='ACTIVE')
+ self.assertRaises(exceptions.NotFound,
+ self.alt_client.delete_server,
+ server['id'])
@attr(type=['negative', 'gate'])
def test_delete_server_pass_negative_id(self):