diff --git a/salt/minion.py b/salt/minion.py index 90f4842e81..9bb4f3cb93 100644 --- a/salt/minion.py +++ b/salt/minion.py @@ -1591,7 +1591,7 @@ class Minion(MinionBase): self._process_beacons() # TODO: rename?? Maybe do_pub_recv and take a list of them? # for some reason, native FDs sometimes return event 5, whatever that is... - if socks.get(self.pub_channel.socket.fileno()): + if socks.get(self.pub_channel.poll_key): print ('got stuff from pub_channel') self._do_socket_recv() diff --git a/salt/transport/client.py b/salt/transport/client.py index 5c43b569b9..87858ac326 100644 --- a/salt/transport/client.py +++ b/salt/transport/client.py @@ -104,4 +104,11 @@ class PubChannel(object): ''' raise NotImplementedError() + @property + def poll_key(self): + ''' + Return the representation that the poller will return + ''' + raise NotImplementedError() + # EOF diff --git a/salt/transport/server.py b/salt/transport/server.py index 04b575e46d..a7cdd5df3b 100644 --- a/salt/transport/server.py +++ b/salt/transport/server.py @@ -109,9 +109,6 @@ class PubServerChannel(object): elif 'transport' in opts.get('pillar', {}).get('master', {}): ttype = opts['pillar']['master']['transport'] - # TODO: remove - ttype = 'tcp' - # switch on available ttypes if ttype == 'zeromq': import salt.transport.zeromq diff --git a/salt/transport/tcp.py b/salt/transport/tcp.py index 7e82776723..bc265220c3 100644 --- a/salt/transport/tcp.py +++ b/salt/transport/tcp.py @@ -94,6 +94,10 @@ class TCPPubChannel(salt.transport.client.PubChannel): def socket(self): return self._socket + @property + def poll_key(self): + return self._socket.fileno() + @property def master_pub(self): ''' diff --git a/salt/transport/zeromq.py b/salt/transport/zeromq.py index 3c51db8687..34379f626c 100644 --- a/salt/transport/zeromq.py +++ b/salt/transport/zeromq.py @@ -282,6 +282,10 @@ class ZeroMQPubChannel(salt.transport.client.PubChannel): def socket(self): return self._socket + @property + def poll_key(self): + return self.socket + class ZeroMQReqServerChannel(salt.transport.server.ReqServerChannel): def zmq_device(self):