Got rid of the global timeout crap, timeout value is used for both singular and

global timeouts
This commit is contained in:
Thomas S Hatch 2011-04-01 10:45:11 -06:00
parent f27bbac438
commit ce16d1caea
2 changed files with 2 additions and 9 deletions

View File

@ -33,12 +33,6 @@ class SaltCMD(object):
type=int,
dest='timeout',
help='Set the return timeout for batch jobs; default=5 seconds')
parser.add_option('-g',
'--global-timeout',
default=10,
type=int,
dest='global_timeout',
help='How long to wait if no minions reply; default=10 seconds')
parser.add_option('-E',
'--pcre',
default=False,
@ -83,7 +77,6 @@ class SaltCMD(object):
opts = {}
opts['timeout'] = options.timeout
opts['global_timeout'] = options.global_timeout
opts['pcre'] = options.pcre
opts['list'] = options.list_
opts['facter'] = options.facter

View File

@ -108,7 +108,7 @@ class LocalClient(object):
'''
return os.listdir(os.path.join(self.opts['pki_dir'], 'minions'))
def get_returns(self, jid, minions, timeout=5, global_timeout=10):
def get_returns(self, jid, minions, timeout=5):
'''
This method starts off a watcher looking at the return data for a
specified jid
@ -137,7 +137,7 @@ class LocalClient(object):
return ret
if int(time.time()) > start + timeout:
return ret
if int(time.time()) > gstart + global_timeout and not ret:
if int(time.time()) > gstart + timeout and not ret:
# No minions have replied within the specified global timeout,
# return an empty dict
return ret