mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 01:18:58 +00:00
Merge pull request #1029 from fatbox/timeout-valueerror
Handle ValueError's when parsing 'tmo' with int()
This commit is contained in:
commit
97e5487e49
@ -719,12 +719,17 @@ class AESFuncs(object):
|
|||||||
expr_form = 'glob'
|
expr_form = 'glob'
|
||||||
timeout = 5
|
timeout = 5
|
||||||
if 'tmo' in clear_load:
|
if 'tmo' in clear_load:
|
||||||
timeout = int(clear_load['tmo'])
|
try:
|
||||||
|
timeout = int(clear_load['tmo'])
|
||||||
|
except ValueError:
|
||||||
|
msg = 'Failed to parse timeout value: {0}'.format(clear_load['tmo'])
|
||||||
|
log.warn(msg)
|
||||||
|
return {}
|
||||||
if 'tgt_type' in clear_load:
|
if 'tgt_type' in clear_load:
|
||||||
load['tgt_type'] = clear_load['tgt_type']
|
load['tgt_type'] = clear_load['tgt_type']
|
||||||
expr_form = load['tgt_type']
|
expr_form = load['tgt_type']
|
||||||
if 'timeout' in clear_load:
|
if 'timeout' in clear_load:
|
||||||
timeout = clear_load('timeout')
|
timeout = clear_load['timeout']
|
||||||
# Encrypt!
|
# Encrypt!
|
||||||
payload['load'] = self.crypticle.dumps(load)
|
payload['load'] = self.crypticle.dumps(load)
|
||||||
# Connect to the publisher
|
# Connect to the publisher
|
||||||
|
Loading…
Reference in New Issue
Block a user