diff options
author | Jenkins <jenkins@review.openstack.org> | 2013-03-06 16:29:23 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2013-03-06 16:29:23 +0000 |
commit | 87a3cb1446300e727fa3d3d78999b4a949cbd47d (patch) | |
tree | 65d491b8e640bc62644e9a82f80c3938e673f32f /openstack/common/rpc | |
parent | dd8c052ecb541c8c950427cd79a2292d4356748c (diff) | |
parent | f32af7b42e7801338583f67e794792f22df70a5d (diff) | |
download | oslo-87a3cb1446300e727fa3d3d78999b4a949cbd47d.tar.gz oslo-87a3cb1446300e727fa3d3d78999b4a949cbd47d.tar.xz oslo-87a3cb1446300e727fa3d3d78999b4a949cbd47d.zip |
Merge "Preserve exceptions in impl_zmq."
Diffstat (limited to 'openstack/common/rpc')
-rw-r--r-- | openstack/common/rpc/impl_zmq.py | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/openstack/common/rpc/impl_zmq.py b/openstack/common/rpc/impl_zmq.py index f408165..7af9cd0 100644 --- a/openstack/common/rpc/impl_zmq.py +++ b/openstack/common/rpc/impl_zmq.py @@ -25,6 +25,7 @@ import eventlet import greenlet from oslo.config import cfg +from openstack.common import excutils from openstack.common.gettextutils import _ from openstack.common import importutils from openstack.common import jsonutils @@ -91,8 +92,8 @@ def _serialize(data): try: return jsonutils.dumps(data, ensure_ascii=True) except TypeError: - LOG.error(_("JSON serialization failed.")) - raise + with excutils.save_and_reraise_exception(): + LOG.error(_("JSON serialization failed.")) def _deserialize(data): @@ -511,9 +512,9 @@ class ZmqProxy(ZmqBaseReactor): ipc_dir, run_as_root=True) utils.execute('chmod', '750', ipc_dir, run_as_root=True) except utils.ProcessExecutionError: - LOG.error(_("Could not create IPC directory %s") % - (ipc_dir, )) - raise + with excutils.save_and_reraise_exception(): + LOG.error(_("Could not create IPC directory %s") % + (ipc_dir, )) try: self.register(consumption_proxy, @@ -521,9 +522,9 @@ class ZmqProxy(ZmqBaseReactor): zmq.PULL, out_bind=True) except zmq.ZMQError: - LOG.error(_("Could not create ZeroMQ receiver daemon. " - "Socket may already be in use.")) - raise + with excutils.save_and_reraise_exception(): + LOG.error(_("Could not create ZeroMQ receiver daemon. " + "Socket may already be in use.")) super(ZmqProxy, self).consume_in_thread() |