Merge "[zmq] Unify delimeters"
This commit is contained in:
commit
885904e9ae
@ -32,21 +32,14 @@ def get_broker_address(conf):
|
|||||||
|
|
||||||
|
|
||||||
def prefix_str(key, listener_type):
|
def prefix_str(key, listener_type):
|
||||||
return listener_type + "_" + key
|
return listener_type + "/" + key
|
||||||
|
|
||||||
|
|
||||||
def target_to_key(target, listener_type=None):
|
def target_to_key(target, listener_type=None):
|
||||||
|
key = target.topic
|
||||||
def prefix(key):
|
if target.server:
|
||||||
return prefix_str(key, listener_type) if listener_type is not None \
|
key += "/" + target.server
|
||||||
else key
|
return prefix_str(key, listener_type) if listener_type 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)
|
|
||||||
|
|
||||||
|
|
||||||
def target_to_subscribe_filter(target):
|
def target_to_subscribe_filter(target):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user