From 000ea52b78b072435f01d67dd799023117e67a2e Mon Sep 17 00:00:00 2001 From: shangxdy Date: Tue, 26 Sep 2017 20:40:39 +0800 Subject: Sync code from nfv-toscaprser Currently nfv-toscaparser has published the regular version of 0.5.1 the patch will synchronize the code. JIRA: MODELING-23 Change-Id: If95579fc366b69b2b14b2e441ff9a3e6807e3820 Signed-off-by: shangxdy --- nfvparser/toscaparser/common/exception.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'nfvparser/toscaparser/common') diff --git a/nfvparser/toscaparser/common/exception.py b/nfvparser/toscaparser/common/exception.py index 13ccabd..67a9f7f 100644 --- a/nfvparser/toscaparser/common/exception.py +++ b/nfvparser/toscaparser/common/exception.py @@ -20,7 +20,7 @@ import traceback from toscaparser.utils.gettextutils import _ -log = logging.getLogger(__name__) +log = logging.getLogger('tosca') class TOSCAException(Exception): @@ -205,6 +205,13 @@ class ExceptionCollector(object): else: raise exception + @staticmethod + def removeException(exception_type): + if ExceptionCollector.collecting and ExceptionCollector.exceptions: + for i, e in enumerate(ExceptionCollector.exceptions): + if isinstance(e, exception_type): + del ExceptionCollector.exceptions[i] + @staticmethod def exceptionsCaught(): return len(ExceptionCollector.exceptions) > 0 -- cgit 1.2.3-korg