summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorshangxdy <shang.xiaodong@zte.com.cn>2018-08-14 21:57:35 +0800
committershangxdy <shang.xiaodong@zte.com.cn>2018-08-15 01:38:17 +0800
commit0a5370bd4de5d17de58d0a71e7683210df0a0352 (patch)
tree0c84f0397266e177a5bc3b0d02fc7e4dfdb80f7b
parentfcda9807cfa6a89d691877126b406c5d3909d9b9 (diff)
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 <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 <shang.xiaodong@zte.com.cn>
-rw-r--r--tosca2heat/tosca-parser/toscaparser/common/exception.py10
1 files changed, 7 insertions, 3 deletions
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():