diff --git a/salt/transport/tcp.py b/salt/transport/tcp.py index e33ab77ad2..22f39a8d4e 100644 --- a/salt/transport/tcp.py +++ b/salt/transport/tcp.py @@ -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)