def _retry_exception(f, steps=((0.1,) * 10), sleep=sleep):
 steps = iter(steps)
 while True:
  try:
   Message.new(message_type=u'flocker:provision:libcloud:retry_exception:trying', function=fullyQualifiedName(f)).write()
   return f()
  except:
   for step in steps:
    write_traceback()
    sleep(step)
    break
   else:
    raise

def _retry_exception ( f , steps = ( ( 0.1 , ) * 10 ) , sleep = sleep ) : steps = iter ( steps ) while True : try : Message . new ( message_type = u'flocker:provision:libcloud:retry_exception:trying' , function = fullyQualifiedName ( f ) ) . write ( ) return f ( ) except : for step in steps : write_traceback ( ) sleep ( step ) break else : raise
retry a function if it raises an exception .