From 27c51046bf4e33a13e22c074953640d2c746cf4d Mon Sep 17 00:00:00 2001 From: Cédric Ollivier Date: Tue, 28 Aug 2018 11:29:35 +0200 Subject: Protect vs TypeErrors when cleaning stacks MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It protects vs exceptions raised by shade when cleaning stacks. Traceback (most recent call last): File "/usr/lib/python2.7/site-packages/functest/opnfv_tests/vnf/ims/heat_ims.py", line 226, in clean self.cloud.delete_stack(self.stack.id, wait=True) File "/usr/lib/python2.7/site-packages/shade/openstackcloud.py", line 1416, in delete_stack marker=marker) File "/usr/lib/python2.7/site-packages/shade/_heat/event_utils.py", line 90, in poll_for_events stack_status = stack['stack_status'] TypeError: 'NoneType' object has no attribute '__getitem__' Change-Id: I1a0ed0cd669d5234ca1ff3b6bbc9d1b13f14b02f Signed-off-by: Cédric Ollivier --- functest/opnfv_tests/vnf/ims/heat_ims.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/functest/opnfv_tests/vnf/ims/heat_ims.py b/functest/opnfv_tests/vnf/ims/heat_ims.py index 7ad1e96bf..3d32b889d 100644 --- a/functest/opnfv_tests/vnf/ims/heat_ims.py +++ b/functest/opnfv_tests/vnf/ims/heat_ims.py @@ -217,6 +217,9 @@ class HeatIms(singlevm.VmReady2): try: if self.stack: self.cloud.delete_stack(self.stack.id, wait=True) + except TypeError: + # shade raises TypeError exceptions when checking stack status + pass except Exception: # pylint: disable=broad-except self.__logger.exception("Cannot clean stack ressources") super(HeatIms, self).clean() -- cgit 1.2.3-korg