diff options
author | Andrew Bogott <abogott@wikimedia.org> | 2012-07-08 06:11:44 -0500 |
---|---|---|
committer | Andrew Bogott <abogott@wikimedia.org> | 2012-07-15 14:01:38 -0500 |
commit | 57e4ee833d1897b5114be193be3b6f7fa38f49bf (patch) | |
tree | a76496e44d66c4b6ef51ff845e3bf641be0f90eb | |
parent | a2c05274afdb81213531225ba802a339ff017d69 (diff) | |
download | nova-57e4ee833d1897b5114be193be3b6f7fa38f49bf.tar.gz nova-57e4ee833d1897b5114be193be3b6f7fa38f49bf.tar.xz nova-57e4ee833d1897b5114be193be3b6f7fa38f49bf.zip |
Catch rpc up to the common state-of-the-art.
This propagates the following patch from common into nova:
Author: Jason Kölker <jason@koelker.net>
Date: Tue Jul 10 11:12:50 2012 -0500
Fix Zmq so it doesn't rely on nova flags
* Embeded newlines in logging makes me cry
* String formatting uses parens not curly braces
* Fix LP1023039
* Hard skip Zmq tests so jenkins passes. Someone will have to fix.
Change-Id: I651aa10861cb26808fa46e74a7db545fb2fd23b8
-rw-r--r-- | nova/openstack/common/rpc/impl_zmq.py | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/nova/openstack/common/rpc/impl_zmq.py b/nova/openstack/common/rpc/impl_zmq.py index 6fd83e67e..fc342de50 100644 --- a/nova/openstack/common/rpc/impl_zmq.py +++ b/nova/openstack/common/rpc/impl_zmq.py @@ -60,6 +60,9 @@ zmq_opts = [ cfg.StrOpt('rpc_zmq_ipc_dir', default='/var/run/openstack', help='Directory for holding IPC sockets'), + cfg.StrOpt('rpc_zmq_host', default=socket.gethostname(), + help='Name of this node. Must be a valid hostname, FQDN, or ' + 'IP address') ] @@ -120,11 +123,12 @@ class ZmqSocket(object): for f in do_sub: self.subscribe(f) - LOG.debug(_("Connecting to %{addr}s with %{type}s" - "\n-> Subscribed to %{subscribe}s" - "\n-> bind: %{bind}s"), - {'addr': addr, 'type': self.socket_s(), - 'subscribe': subscribe, 'bind': bind}) + str_data = {'addr': addr, 'type': self.socket_s(), + 'subscribe': subscribe, 'bind': bind} + + LOG.debug(_("Connecting to %(addr)s with %(type)s"), str_data) + LOG.debug(_("-> Subscribed to %(subscribe)s"), str_data) + LOG.debug(_("-> bind: %(bind)s"), str_data) try: if bind: @@ -543,8 +547,7 @@ def _call(addr, context, msg_id, topic, msg, timeout=None): msg_id = str(uuid.uuid4().hex) # Replies always come into the reply service. - # We require that FLAGS.host is a FQDN, IP, or resolvable hostname. - reply_topic = "zmq_replies.%s" % FLAGS.host + reply_topic = "zmq_replies.%s" % FLAGS.rpc_zmq_host LOG.debug(_("Creating payload")) # Curry the original request into a reply method. @@ -708,7 +711,7 @@ def register_opts(conf): if mm_path[-1][0] not in string.ascii_uppercase: LOG.error(_("Matchmaker could not be loaded.\n" "rpc_zmq_matchmaker is not a class.")) - raise + raise RPCException(_("Error loading Matchmaker.")) mm_impl = importutils.import_module(mm_module) mm_constructor = getattr(mm_impl, mm_class) |