mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Support comma separated minion list in TCP transport
This commit is contained in:
parent
7c5fef13a9
commit
f303a9b864
@ -1336,6 +1336,7 @@ class TCPPubServerChannel(salt.transport.server.PubServerChannel):
|
||||
def __init__(self, opts):
|
||||
self.opts = opts
|
||||
self.serial = salt.payload.Serial(self.opts) # TODO: in init?
|
||||
self.ckminions = salt.utils.minions.CkMinions(opts)
|
||||
self.io_loop = None
|
||||
|
||||
def __setstate__(self, state):
|
||||
@ -1440,6 +1441,16 @@ class TCPPubServerChannel(salt.transport.server.PubServerChannel):
|
||||
|
||||
# add some targeting stuff for lists only (for now)
|
||||
if load['tgt_type'] == 'list':
|
||||
if isinstance(load['tgt'], six.string_types):
|
||||
# Fetch a list of minions that match
|
||||
_res = self.ckminions.check_minions(load['tgt'],
|
||||
tgt_type=load['tgt_type'])
|
||||
match_ids = _res['minions']
|
||||
|
||||
log.debug("Publish Side Match: %s", match_ids)
|
||||
# Send list of miions thru so zmq can target them
|
||||
int_payload['topic_lst'] = match_ids
|
||||
else:
|
||||
int_payload['topic_lst'] = load['tgt']
|
||||
# Send it over IPC!
|
||||
pub_sock.send(int_payload)
|
||||
|
Loading…
Reference in New Issue
Block a user