#NEWLINE# def _state_wait_gone( self , f , f_args = None , f_kwargs = None ) : #NEWLINE# #INDENT# interval = self . default_check_interval #NEWLINE# start_time = time . time ( ) #NEWLINE# args = ( f_args if ( f_args is not None ) else [ ] ) #NEWLINE# kwargs = ( f_kwargs if ( f_kwargs is not None ) else { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } ) #NEWLINE# try : #NEWLINE# #INDENT# old_status = status = f ( * args , ** kwargs ) #NEWLINE# while True : #NEWLINE# #INDENT# if ( status != old_status ) : #NEWLINE# #INDENT# LOG . info ( 'State transition "%s" ==> "%s" %d second' , old_status , status , ( time . time ( ) - start_time ) ) #NEWLINE# #UNINDENT# dtime = ( time . time ( ) - start_time ) #NEWLINE# if ( dtime > self . default_timeout ) : #NEWLINE# #INDENT# raise testtools . TestCase . failureException ( 'State change timeout exceeded while waiting for deleting' ) #NEWLINE# #UNINDENT# time . sleep ( interval ) #NEWLINE# interval += self . default_check_interval #NEWLINE# old_status = status #NEWLINE# status = f ( * args , ** kwargs ) #NEWLINE# #UNINDENT# #UNINDENT# except exceptions . NotFound : #NEWLINE# #INDENT# pass