diff options
author | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-08-28 11:29:35 +0200 |
---|---|---|
committer | Cédric Ollivier <cedric.ollivier@orange.com> | 2018-08-28 11:33:23 +0200 |
commit | 27c51046bf4e33a13e22c074953640d2c746cf4d (patch) | |
tree | b51f271713e4d812d22d5849a8872ca8ab47404a | |
parent | d176e20067368d834e8b77d4f685f48cb54d03f5 (diff) |
Protect vs TypeErrors when cleaning stacks
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 <cedric.ollivier@orange.com>
-rw-r--r-- | functest/opnfv_tests/vnf/ims/heat_ims.py | 3 |
1 files changed, 3 insertions, 0 deletions
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() |