Skip to content
Snippets Groups Projects
Commit fabbac88 authored by Brandon Heller's avatar Brandon Heller
Browse files

Document retry function

parent 2e52801d
No related branches found
No related tags found
No related merge requests found
......@@ -399,7 +399,13 @@ def moveIntf( intf, node, print_error = False ):
return True
def retry( n, retry_delay, fn, *args):
"Try something N times before giving up."
'''Try something N times before giving up.
@param n number of times to retry
@param retry_delay seconds wait this long between tries
@param fn function to call
@param args args to apply to function call
'''
tries = 0
while not apply( fn, args ) and tries < n:
sleep( retry_delay )
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment