#NEWLINE# def wait_stack_completion( cluster , is_update = False , last_updated_time = None ) : #NEWLINE# #INDENT# stack_name = cluster . stack_name #NEWLINE# stack = get_stack ( stack_name ) #NEWLINE# while ( not _verify_completion ( stack , is_update , last_updated_time ) ) : #NEWLINE# #INDENT# context . sleep ( 1 ) #NEWLINE# stack = get_stack ( stack_name ) #NEWLINE# #UNINDENT# if ( stack . status != 'COMPLETE' ) : #NEWLINE# #INDENT# raise ex . HeatStackException ( stack . stack_status_reason )