diff --git a/salt/client/ssh/__init__.py b/salt/client/ssh/__init__.py index da9fa81f4c..9c950a5839 100644 --- a/salt/client/ssh/__init__.py +++ b/salt/client/ssh/__init__.py @@ -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) diff --git a/salt/roster/__init__.py b/salt/roster/__init__.py index 37dc18dcd5..77ef61b29d 100644 --- a/salt/roster/__init__.py +++ b/salt/roster/__init__.py @@ -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