mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Normalize IPC check among transports
This commit is contained in:
parent
e8ead2bfed
commit
9b18f372e6
4 changed files with 8 additions and 6 deletions
|
@ -38,9 +38,13 @@ class NetapiClient(object):
|
|||
Note, this will return an invalid success if the master crashed or was
|
||||
not shut down cleanly.
|
||||
'''
|
||||
if self.opts['transport'] == 'tcp':
|
||||
ipc_file = 'publish_pull.ipc'
|
||||
else:
|
||||
ipc_file = 'workers.ipc'
|
||||
return os.path.exists(os.path.join(
|
||||
self.opts['sock_dir'],
|
||||
'workers.ipc'))
|
||||
ipc_file))
|
||||
|
||||
def run(self, low):
|
||||
'''
|
||||
|
|
|
@ -82,11 +82,9 @@ class AsyncTCPReqChannel(salt.transport.client.ReqChannel):
|
|||
|
||||
@classmethod
|
||||
def __key(cls, opts, **kwargs):
|
||||
if 'master_uri' in kwargs:
|
||||
opts['master_uri'] = kwargs['master_uri']
|
||||
return (opts['pki_dir'], # where the keys are stored
|
||||
opts['id'], # minion ID
|
||||
opts['master_uri'], # master ID
|
||||
kwargs.get('master_uri', opts.get('master_uri')), # master ID
|
||||
kwargs.get('crypt', 'aes'), # TODO: use the same channel for crypt
|
||||
)
|
||||
|
||||
|
|
|
@ -63,7 +63,7 @@ class WheelClient(mixins.SyncClientMixin, mixins.AsyncClientMixin, object):
|
|||
channel = salt.transport.Channel.factory(self.opts,
|
||||
crypt='clear',
|
||||
master_uri=master_uri)
|
||||
ret = channel.send(load)
|
||||
ret = channel.send({})
|
||||
if isinstance(ret, collections.Mapping):
|
||||
if 'error' in ret:
|
||||
raise_error(**ret['error'])
|
||||
|
|
|
@ -170,7 +170,7 @@ class MatchTest(integration.ShellCase, integration.ShellCaseCommonTestsMixIn):
|
|||
self.assertNotIn('minion', data.replace('sub_minion', 'stub'))
|
||||
data = self.run_salt('-G "planets:pluto" test.ping')
|
||||
expect = None
|
||||
if self.master_opts['transport'] == 'zeromq':
|
||||
if self.master_opts['transport'] in ('zeromq', 'tcp'):
|
||||
expect = (
|
||||
'No minions matched the target. '
|
||||
'No command was sent, no jid was '
|
||||
|
|
Loading…
Add table
Reference in a new issue