Add support to detect the backend to the factory

This commit is contained in:
Thomas S Hatch 2016-06-13 16:47:42 -06:00
parent 4ad8a04d3b
commit ebead18ee8

View File

@ -147,6 +147,13 @@ class AsyncPubChannel(AsyncChannel):
ttype = opts['transport'] ttype = opts['transport']
elif 'transport' in opts.get('pillar', {}).get('master', {}): elif 'transport' in opts.get('pillar', {}).get('master', {}):
ttype = opts['pillar']['master']['transport'] ttype = opts['pillar']['master']['transport']
if ttype == 'detect':
opts['__last_transport'] = 'tcp'
opts['transport'] = 'tcp'
ttype = opts['transport']
elif '__last_transport' in opts:
opts['transport'] = 'zeromq' if opts['transport'] == 'tcp' else 'tcp'
ttype = opts['transport']
# switch on available ttypes # switch on available ttypes
if ttype == 'zeromq': if ttype == 'zeromq':