mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
Merge pull request #45778 from DSRCorporation/bugs/jenkins-813_missing_minion_test_fail
Support comma separated minion list target in payload for TCP transport
This commit is contained in:
commit
42467ed2f9
@ -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':
|
||||
int_payload['topic_lst'] = load['tgt']
|
||||
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