summaryrefslogtreecommitdiffstats
path: root/openstack
diff options
context:
space:
mode:
authorJason Kölker <jason@koelker.net>2012-07-10 11:12:50 -0500
committerJason Kölker <jason@koelker.net>2012-07-10 11:46:10 -0500
commit44beb84b48051ff374bde6088688d6759a1807eb (patch)
tree313962937349033f876403b230631a578bfc7015 /openstack
parent22ccc58df8886531b649a8d95251bfd02d40c62a (diff)
downloadoslo-44beb84b48051ff374bde6088688d6759a1807eb.tar.gz
oslo-44beb84b48051ff374bde6088688d6759a1807eb.tar.xz
oslo-44beb84b48051ff374bde6088688d6759a1807eb.zip
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: I9b12ac47b02edf1d8dba7236550deb8ee33f5e07
Diffstat (limited to 'openstack')
-rw-r--r--openstack/common/rpc/impl_zmq.py18
1 files changed, 11 insertions, 7 deletions
diff --git a/openstack/common/rpc/impl_zmq.py b/openstack/common/rpc/impl_zmq.py
index 3eefa96..77723ca 100644
--- a/openstack/common/rpc/impl_zmq.py
+++ b/openstack/common/rpc/impl_zmq.py
@@ -15,6 +15,7 @@
# under the License.
import pprint
+import socket
import string
import sys
import types
@@ -59,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')
]
@@ -119,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:
@@ -542,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.