From 0a5370bd4de5d17de58d0a71e7683210df0a0352 Mon Sep 17 00:00:00 2001 From: shangxdy Date: Tue, 14 Aug 2018 21:57:35 +0800 Subject: parameter -nrpv not fuctioning in toscaparser In opnfv-toscaparer ver 1.0.1, when passing -nrpv to prohibit the input parameter validation, i.e. toscaparser --template-file -nrpv The exceptions of type MissingRequiredParameterError are still got raised. Seems that -nrpv parameter is not working. JIRA: PARSER-181 Change-Id: If44eefcc2b7bdb360eae023ed2c2cd67789c2128 Signed-off-by: shangxdy --- tosca2heat/tosca-parser/toscaparser/common/exception.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'tosca2heat') diff --git a/tosca2heat/tosca-parser/toscaparser/common/exception.py b/tosca2heat/tosca-parser/toscaparser/common/exception.py index 67a9f7f..d36a714 100644 --- a/tosca2heat/tosca-parser/toscaparser/common/exception.py +++ b/tosca2heat/tosca-parser/toscaparser/common/exception.py @@ -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(): -- cgit 1.2.3-korg