#NEWLINE# def do( self , workflow_dict ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# databaseinfra = driver [ 'databaseinfra' ] #NEWLINE# driver = databaseinfra . get_driver ( ) #NEWLINE# instance = workflow_dict [ 'source_instances' ] [ 0 ] . future_instance #NEWLINE# for attempt in range ( 0 , 21 ) : #NEWLINE# #INDENT# LOG . info ( 'Waiting 10s to check replication...' ) #NEWLINE# sleep ( 10 ) #NEWLINE# if driver . is_replication_ok ( instance ) : #NEWLINE# #INDENT# return True #NEWLINE# #UNINDENT# #UNINDENT# raise Exception ( 'The replication is not ok' ) #NEWLINE# #UNINDENT# except Exception : #NEWLINE# #INDENT# traceback = full_stack ( ) #NEWLINE# workflow_dict [ 'exceptions' ] [ 'error_codes' ] . append ( DBAAS_0020 ) #NEWLINE# workflow_dict [ 'exceptions' ] [ 'traceback' ] . append ( traceback )