mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
handle no minions targeted case
This commit is contained in:
parent
dbb666a5ae
commit
91219d4b88
@ -189,6 +189,8 @@ class LocalClient(object):
|
||||
if pub_data['jid'] == '0':
|
||||
# Failed to connect to the master and send the pub
|
||||
return {}
|
||||
elif not pub_data['jid']:
|
||||
return {}
|
||||
return self.get_returns(pub_data['jid'], pub_data['minions'], timeout)
|
||||
|
||||
def cmd_cli(
|
||||
@ -220,6 +222,9 @@ class LocalClient(object):
|
||||
if pub_data['jid'] == '0':
|
||||
print 'Failed to connect to the Master, is the Salt Master running?'
|
||||
yield {}
|
||||
elif not pub_data['jid']:
|
||||
print 'No minions match the target'
|
||||
yield {}
|
||||
else:
|
||||
for fn_ret in self.get_cli_returns(pub_data['jid'],
|
||||
pub_data['minions'],
|
||||
@ -259,6 +264,8 @@ class LocalClient(object):
|
||||
if pub_data['jid'] == '0':
|
||||
# Failed to connect to the master and send the pub
|
||||
yield {}
|
||||
elif not pub_data['jid']:
|
||||
yield {}
|
||||
else:
|
||||
for fn_ret in self.get_iter_returns(pub_data['jid'],
|
||||
pub_data['minions'],
|
||||
@ -295,6 +302,8 @@ class LocalClient(object):
|
||||
if pub_data['jid'] == '0':
|
||||
# Failed to connect to the master and send the pub
|
||||
yield {}
|
||||
elif not pub_data['jid']:
|
||||
yield {}
|
||||
else:
|
||||
for fn_ret in self.get_iter_returns(pub_data['jid'],
|
||||
pub_data['minions'],
|
||||
@ -329,6 +338,8 @@ class LocalClient(object):
|
||||
if pub_data['jid'] == '0':
|
||||
# Failed to connect to the master and send the pub
|
||||
return {}
|
||||
elif not pub_data['jid']:
|
||||
return {}
|
||||
return (self.get_returns(pub_data['jid'],
|
||||
pub_data['minions'], timeout))
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user