summaryrefslogtreecommitdiff
path: root/heat
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2015-08-13 11:29:23 +0000
committerGerrit Code Review <review@openstack.org>2015-08-13 11:29:23 +0000
commitc940c38abed32b08f1984faee1a6166af5c0fdc9 (patch)
tree5cc5bb17b2e276b7f57456cf3f5c77f720f3ec7d /heat
parent69e4b69909e8b790d43f8e27c7a541fde88bd59c (diff)
parentc7bfd980b25b9f28a35fe8d3204bcc6365f0a51b (diff)
downloadheat-c940c38abed32b08f1984faee1a6166af5c0fdc9.tar.gz
Merge "Remove 'wrap_exception' function"
Diffstat (limited to 'heat')
-rw-r--r--heat/common/exception.py47
1 files changed, 0 insertions, 47 deletions
diff --git a/heat/common/exception.py b/heat/common/exception.py
index 637942486..9b65cd9b6 100644
--- a/heat/common/exception.py
+++ b/heat/common/exception.py
@@ -46,53 +46,6 @@ class KeystoneError(Exception):
return "Code: %s, message: %s" % (self.code, self.message)
-def wrap_exception(notifier=None, publisher_id=None, event_type=None,
- level=None):
- """This decorator wraps a method to catch any exceptions that may
- get thrown. It logs the exception as well as optionally sending
- it to the notification system.
- """
- # TODO(sandy): Find a way to import nova.notifier.api so we don't have
- # to pass it in as a parameter. Otherwise we get a cyclic import of
- # nova.notifier.api -> nova.utils -> nova.exception :(
- # TODO(johannes): Also, it would be nice to use
- # utils.save_and_reraise_exception() without an import loop
- def inner(f):
- def wrapped(*args, **kw):
- try:
- return f(*args, **kw)
- except Exception as e:
- # Save exception since it can be clobbered during processing
- # below before we can re-raise
- exc_info = sys.exc_info()
-
- if notifier:
- payload = dict(args=args, exception=e)
- payload.update(kw)
-
- # Use a temp vars so we don't shadow
- # our outer definitions.
- temp_level = level
- if not temp_level:
- temp_level = notifier.ERROR
-
- temp_type = event_type
- if not temp_type:
- # If f has multiple decorators, they must use
- # six.wraps to ensure the name is
- # propagated.
- temp_type = f.__name__
-
- notifier.notify(publisher_id, temp_type, temp_level,
- payload)
-
- # re-raise original exception since it may have been clobbered
- raise_(exc_info[0], exc_info[1], exc_info[2])
-
- return six.wraps(f)(wrapped)
- return inner
-
-
@six.python_2_unicode_compatible
class HeatException(Exception):
"""Base Heat Exception