mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
fix http wait for state
This commit is contained in:
parent
e8e3b3c8ff
commit
ca6936f6eb
@ -132,8 +132,18 @@ def wait_for_successful_query(name, wait_for=300, **kwargs):
|
|||||||
Like query but, repeat and wait until match/match_type or status is fulfilled. State returns result from last
|
Like query but, repeat and wait until match/match_type or status is fulfilled. State returns result from last
|
||||||
query state in case of success or if no successful query was made within wait_for timeout.
|
query state in case of success or if no successful query was made within wait_for timeout.
|
||||||
|
|
||||||
|
name
|
||||||
|
The name of the query.
|
||||||
|
|
||||||
|
wait_for
|
||||||
|
Total time to wait for requests that succeed.
|
||||||
|
|
||||||
request_interval
|
request_interval
|
||||||
Optional interval to delay requests by N seconds to reduce the number of requests sent.
|
Optional interval to delay requests by N seconds to reduce the number of requests sent.
|
||||||
|
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
All other arguements are passed to the http.query state.
|
||||||
'''
|
'''
|
||||||
starttime = time.time()
|
starttime = time.time()
|
||||||
|
|
||||||
@ -141,7 +151,7 @@ def wait_for_successful_query(name, wait_for=300, **kwargs):
|
|||||||
caught_exception = None
|
caught_exception = None
|
||||||
ret = None
|
ret = None
|
||||||
try:
|
try:
|
||||||
ret = query(name, wait_for=wait_for, **kwargs)
|
ret = query(name, **kwargs)
|
||||||
if ret['result']:
|
if ret['result']:
|
||||||
return ret
|
return ret
|
||||||
except Exception as exc:
|
except Exception as exc:
|
||||||
|
Loading…
Reference in New Issue
Block a user