~ubuntu-branches/ubuntu/trusty/ceilometer/trusty-proposed

« back to all changes in this revision

Viewing changes to ceilometer/openstack/common/excutils.py

  • Committer: Package Import Robot
  • Author(s): Chuck Short, James Page, Chuck Short
  • Date: 2014-01-23 15:08:11 UTC
  • mfrom: (1.1.11)
  • Revision ID: package-import@ubuntu.com-20140123150811-1zaismsuyh1hcl8y
Tags: 2014.1~b2-0ubuntu1
[ James Page ]
* d/control: Add python-jsonpath-rw to BD's.
* d/p/fix-setup-requirements.patch: Bump WebOb to support < 1.4.
 (LP: #1261101)

[ Chuck Short ]
* New upstream version.
* debian/control, debian/ceilometer-common.install: Split out
  ceilometer-alarm-evaluator and ceilometer-alarm-notifier into their
  own packages. (LP: #1250002)
* debian/ceilometer-agent-central.logrotate,
  debian/ceilometer-agent-compute.logrotate,
  debian/ceilometer-api.logrotate,
  debian/ceilometer-collector.logrotate: Add logrotate files, 
  thanks to Ahmed Rahal. (LP: #1224223)
* Fix typos in upstart files.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
import six
26
26
 
27
 
from ceilometer.openstack.common.gettextutils import _  # noqa
 
27
from ceilometer.openstack.common.gettextutils import _
28
28
 
29
29
 
30
30
class save_and_reraise_exception(object):
42
42
 
43
43
    In some cases the caller may not want to re-raise the exception, and
44
44
    for those circumstances this context provides a reraise flag that
45
 
    can be used to suppress the exception.  For example:
 
45
    can be used to suppress the exception.  For example::
46
46
 
47
 
    except Exception:
48
 
        with save_and_reraise_exception() as ctxt:
49
 
            decide_if_need_reraise()
50
 
            if not should_be_reraised:
51
 
                ctxt.reraise = False
 
47
      except Exception:
 
48
          with save_and_reraise_exception() as ctxt:
 
49
              decide_if_need_reraise()
 
50
              if not should_be_reraised:
 
51
                  ctxt.reraise = False
52
52
    """
53
53
    def __init__(self):
54
54
        self.reraise = True