Merge pull request #10325 from s0undt3ch/hotfix/revert-reuse-channels

revert reuse channels
This commit is contained in:
Thomas S Hatch 2014-02-10 19:11:25 -07:00
commit e0467c253d

View File

@ -5,14 +5,9 @@ Encapsulate the different transports available to Salt. Currently this is only
import salt.payload
import salt.auth
import os
class Channel(object):
# store a cache of the channels so a single pid can re-use a connection.
# This needs to be per pid as when you fork you keep the original memory
# space and we can't control currency across pids
channel_cache = {}
@staticmethod
def factory(opts, **kwargs):
# Default to ZeroMQ for now
@ -24,10 +19,7 @@ class Channel(object):
ttype = opts['pillar']['master']['transport_type']
if ttype == 'zeromq':
pid = os.getpid()
if pid not in Channel.channel_cache:
Channel.channel_cache[pid] = ZeroMQChannel(opts, **kwargs)
return Channel.channel_cache[pid]
return ZeroMQChannel(opts, **kwargs)
else:
raise Exception("Channels are only defined for ZeroMQ")
# return NewKindOfChannel(opts, **kwargs)