mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #37178 from isbm/isbm-fix-saltapi-ssh-crash
Fix Salt-API ssh crash
This commit is contained in:
commit
d608465d77
@ -179,7 +179,7 @@ class SSH(object):
|
||||
raise salt.exceptions.SaltSystemExit('No ssh binary found in path -- ssh must be installed for salt-ssh to run. Exiting.')
|
||||
self.opts['_ssh_version'] = ssh_version()
|
||||
self.tgt_type = self.opts['selected_target_option'] \
|
||||
if self.opts['selected_target_option'] else 'glob'
|
||||
if self.opts['selected_target_option'] else 'glob'
|
||||
self.roster = salt.roster.Roster(opts, opts.get('roster', 'flat'))
|
||||
self.targets = self.roster.targets(
|
||||
self.opts['tgt'],
|
||||
@ -385,9 +385,10 @@ class SSH(object):
|
||||
returned = set()
|
||||
rets = set()
|
||||
init = False
|
||||
if not self.targets:
|
||||
raise salt.exceptions.SaltClientError('No matching targets found in roster.')
|
||||
while True:
|
||||
if not self.targets:
|
||||
log.error('No matching targets found in roster.')
|
||||
break
|
||||
if len(running) < self.opts.get('ssh_max_procs', 25) and not init:
|
||||
try:
|
||||
host = next(target_iter)
|
||||
|
@ -82,12 +82,5 @@ class Roster(object):
|
||||
except IOError as exc:
|
||||
pass
|
||||
|
||||
if not targets:
|
||||
raise salt.exceptions.SaltSystemExit(
|
||||
'No hosts found with target {0} of type {1}'.format(
|
||||
tgt,
|
||||
tgt_type)
|
||||
)
|
||||
|
||||
log.debug('Matched minions: {0}'.format(targets))
|
||||
return targets
|
||||
|
Loading…
Reference in New Issue
Block a user