From: shangxdy Date: Tue, 14 Aug 2018 13:57:35 +0000 (+0800) Subject: parameter -nrpv not fuctioning in toscaparser X-Git-Tag: 1.1.0~3^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=0a5370bd4de5d17de58d0a71e7683210df0a0352;p=parser.git 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 --- 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():