summaryrefslogtreecommitdiffstats
path: root/openstack/common
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2013-07-03 17:20:21 +0000
committerGerrit Code Review <review@openstack.org>2013-07-03 17:20:21 +0000
commite912382db1d62ae97ff451ea8ca25830207fe335 (patch)
treef6f251038288ae58b4b21b39826c1966cb0bd04e /openstack/common
parent085dd69acdd5c8c216271dc8890c4107363190fb (diff)
parentdea334a3f55ee7876fdb1b4717e7be8f21499b81 (diff)
downloadoslo-e912382db1d62ae97ff451ea8ca25830207fe335.tar.gz
oslo-e912382db1d62ae97ff451ea8ca25830207fe335.tar.xz
oslo-e912382db1d62ae97ff451ea8ca25830207fe335.zip
Merge "Replace sys.exit by a RPCException"
Diffstat (limited to 'openstack/common')
-rw-r--r--openstack/common/rpc/impl_kombu.py13
1 files changed, 5 insertions, 8 deletions
diff --git a/openstack/common/rpc/impl_kombu.py b/openstack/common/rpc/impl_kombu.py
index 8fb3504..36d2fc5 100644
--- a/openstack/common/rpc/impl_kombu.py
+++ b/openstack/common/rpc/impl_kombu.py
@@ -18,7 +18,6 @@ import functools
import itertools
import socket
import ssl
-import sys
import time
import uuid
@@ -561,13 +560,11 @@ class Connection(object):
log_info.update(params)
if self.max_retries and attempt == self.max_retries:
- LOG.error(_('Unable to connect to AMQP server on '
- '%(hostname)s:%(port)d after %(max_retries)d '
- 'tries: %(err_str)s') % log_info)
- # NOTE(comstud): Copied from original code. There's
- # really no better recourse because if this was a queue we
- # need to consume on, we have no way to consume anymore.
- sys.exit(1)
+ msg = _('Unable to connect to AMQP server on '
+ '%(hostname)s:%(port)d after %(max_retries)d '
+ 'tries: %(err_str)s') % log_info
+ LOG.error(msg)
+ raise rpc_common.RPCException(msg)
if attempt == 1:
sleep_time = self.interval_start or 1