mirror of
https://github.com/valitydev/salt.git
synced 2024-11-09 01:36:48 +00:00
Switch remaining uses of sreq to channel
This commit is contained in:
parent
7c93360a82
commit
62d9d3cdad
@ -28,6 +28,7 @@ from salt.ext.six.moves import input
|
||||
# Import salt libs
|
||||
import salt.config
|
||||
import salt.loader
|
||||
import salt.transport.channel
|
||||
import salt.utils
|
||||
import salt.utils.minions
|
||||
import salt.payload
|
||||
@ -337,20 +338,17 @@ class Resolver(object):
|
||||
|
||||
def _send_token_request(self, load):
|
||||
if self.opts['transport'] == 'zeromq':
|
||||
sreq = salt.payload.SREQ(
|
||||
'tcp://{0}:{1}'.format(
|
||||
salt.utils.ip_bracket(self.opts['interface']),
|
||||
self.opts['ret_port']),
|
||||
opts=self.opts
|
||||
)
|
||||
tdata = sreq.send('clear', load)
|
||||
return tdata
|
||||
master_uri = 'tcp://' + salt.utils.ip_bracket(self.opts['interface']) + \
|
||||
':' + str(self.opts['ret_port'])
|
||||
channel = salt.transport.channel.ReqChannel.factory(self.opts,
|
||||
crypt='clear',
|
||||
master_uri=master_uri)
|
||||
return channel.send(load)
|
||||
|
||||
elif self.opts['transport'] == 'raet':
|
||||
sreq = salt.transport.Channel.factory(
|
||||
self.opts)
|
||||
sreq.dst = (None, None, 'local_cmd')
|
||||
tdata = sreq.send(load)
|
||||
return tdata
|
||||
channel = salt.transport.channel.ReqChannel.factory(self.opts)
|
||||
channel.dst = (None, None, 'local_cmd')
|
||||
return channel.send(load)
|
||||
|
||||
def cli(self, eauth):
|
||||
'''
|
||||
|
@ -28,6 +28,7 @@ except ImportError:
|
||||
import salt.defaults.exitcodes
|
||||
import salt.utils
|
||||
import salt.payload
|
||||
import salt.transport.channel
|
||||
import salt.utils.verify
|
||||
import salt.version
|
||||
from salt.exceptions import (
|
||||
@ -685,14 +686,11 @@ class SAuth(object):
|
||||
|
||||
auth['master_uri'] = self.opts['master_uri']
|
||||
|
||||
sreq = salt.payload.SREQ(
|
||||
self.opts['master_uri'],
|
||||
opts=self.opts
|
||||
)
|
||||
channel = salt.transport.channel.ReqChannel.factory(self.opts, crypt='clear')
|
||||
|
||||
try:
|
||||
payload = sreq.send_auto(
|
||||
self.minion_sign_in_payload(),
|
||||
payload = channel.send(
|
||||
self.minion_sign_in_payload()['load'], # TODO: change func to retur load instead of payload
|
||||
tries=tries,
|
||||
timeout=timeout
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user