summaryrefslogtreecommitdiffstats
path: root/nfvparser/toscaparser/common
diff options
context:
space:
mode:
authorshangxdy <shang.xiaodong@zte.com.cn>2017-09-26 20:40:39 +0800
committershangxdy <shang.xiaodong@zte.com.cn>2017-09-26 20:47:53 +0800
commit000ea52b78b072435f01d67dd799023117e67a2e (patch)
tree1f14cdb4485e2184904b553b82afd9e7139a18e5 /nfvparser/toscaparser/common
parent53065490134870ead778bff590cfd9e43ddd9f77 (diff)
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 <shang.xiaodong@zte.com.cn>
Diffstat (limited to 'nfvparser/toscaparser/common')
-rw-r--r--nfvparser/toscaparser/common/exception.py9
1 files changed, 8 insertions, 1 deletions
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):
@@ -206,6 +206,13 @@ class ExceptionCollector(object):
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