[zmq] Unify delimeters

This patch simply replaces all delimeters used for generating
internal identifiers like redis keys or socket identities
with slashes (since they are visually better for debugging than
dots, hyphens or underscores, which may also occur inside
topic or server names).

Change-Id: I8e8e80f467404a87a2526c80c8fae6cba5880c6d
This commit is contained in:
Gevorg Davoian 2016-09-12 22:57:01 +03:00
parent c3df59e1ab
commit b3cb65a02c

@ -32,21 +32,14 @@ def get_broker_address(conf):
def prefix_str(key, listener_type):
return listener_type + "_" + key
return listener_type + "/" + key
def target_to_key(target, listener_type=None):
def prefix(key):
return prefix_str(key, listener_type) if listener_type is not None \
else key
if target.topic and target.server:
attributes = ['topic', 'server']
key = ".".join(getattr(target, attr) for attr in attributes)
return prefix(key)
if target.topic:
return prefix(target.topic)
key = target.topic
if target.server:
key += "/" + target.server
return prefix_str(key, listener_type) if listener_type else key
def target_to_subscribe_filter(target):