From ab71c799a7a732a8b3eb72ae80c32ac9419d308b Mon Sep 17 00:00:00 2001 From: Bin Zhou Date: Wed, 6 Jul 2016 16:33:45 +0800 Subject: [PATCH] Correct reraising of exception when an exception was caught and rethrown, it should call 'raise' without any arguments. Change-Id: Id31c042bab14097b13e9ef8c088ff637dc85903f --- heat_integrationtests/scenario/test_server_cfn_init.py | 7 ++----- .../scenario/test_server_software_config.py | 4 ---- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/heat_integrationtests/scenario/test_server_cfn_init.py b/heat_integrationtests/scenario/test_server_cfn_init.py index d3ee7ee9b..7ed608258 100644 --- a/heat_integrationtests/scenario/test_server_cfn_init.py +++ b/heat_integrationtests/scenario/test_server_cfn_init.py @@ -36,9 +36,6 @@ class CfnInitIntegrationTest(scenario_base.ScenarioTestsBase): try: self._wait_for_resource_status( sid, 'WaitCondition', 'CREATE_COMPLETE') - except (exceptions.StackResourceBuildErrorException, - exceptions.TimeoutException) as e: - raise e finally: # attempt to log the server console regardless of WaitCondition # going to complete. This allows successful and failed cloud-init @@ -87,9 +84,9 @@ class CfnInitIntegrationTest(scenario_base.ScenarioTestsBase): server_ip, username='ec2-user') linux_client.validate_authentication() except (exceptions.ServerUnreachable, - exceptions.SSHTimeout) as e: + exceptions.SSHTimeout): self._log_console_output(servers=[server]) - raise e + raise def test_server_cfn_init(self): """Check cfn-init and cfn-signal availability on the created server. diff --git a/heat_integrationtests/scenario/test_server_software_config.py b/heat_integrationtests/scenario/test_server_software_config.py index 75de02ee1..ec12fda17 100644 --- a/heat_integrationtests/scenario/test_server_software_config.py +++ b/heat_integrationtests/scenario/test_server_software_config.py @@ -13,7 +13,6 @@ from heatclient.common import template_utils import six -from heat_integrationtests.common import exceptions from heat_integrationtests.scenario import scenario_base CFG1_SH = '''#!/bin/sh @@ -69,9 +68,6 @@ class SoftwareConfigIntegrationTest(scenario_base.ScenarioTestsBase): for res in ('dep2a', 'dep2b', 'dep1', 'dep3'): self._wait_for_resource_status( sid, res, 'CREATE_COMPLETE') - except (exceptions.StackResourceBuildErrorException, - exceptions.TimeoutException) as e: - raise e finally: # attempt to log the server console regardless of deployments # going to complete. This allows successful and failed boot