Merge "parameter -nrpv not fuctioning in toscaparser"
authorxiaodong shang <shang.xiaodong@zte.com.cn>
Wed, 15 Aug 2018 16:05:39 +0000 (16:05 +0000)
committerGerrit Code Review <gerrit@opnfv.org>
Wed, 15 Aug 2018 16:05:39 +0000 (16:05 +0000)
tosca2heat/tosca-parser/toscaparser/common/exception.py

index 67a9f7f..d36a714 100644 (file)
@@ -207,10 +207,14 @@ class ExceptionCollector(object):
 
     @staticmethod
     def removeException(exception_type):
-        if ExceptionCollector.collecting and ExceptionCollector.exceptions:
+        # if ExceptionCollector.collecting and ExceptionCollector.exceptions:
+        if ExceptionCollector.exceptions:
+            tmp_exceptions = []
             for i, e in enumerate(ExceptionCollector.exceptions):
-                if isinstance(e, exception_type):
-                    del ExceptionCollector.exceptions[i]
+                if not isinstance(e, exception_type):
+                    tmp_exceptions.append(e)
+                    # del ExceptionCollector.exceptions[i]
+            ExceptionCollector.exceptions = tmp_exceptions
 
     @staticmethod
     def exceptionsCaught():