#NEWLINE# def undo( self , workflow_dict ) : #NEWLINE# #INDENT# LOG . info ( 'Running undo...' ) #NEWLINE# try : #NEWLINE# #INDENT# from dbaas_nfsaas.models import HostAttr #NEWLINE# databaseinfra = workflow_dict [ 'databaseinfra' ] #NEWLINE# instance = workflow_dict [ 'source_instances' ] [ 0 ] #NEWLINE# if ( ( 'database_locked' in workflow_dict ) and workflow_dict [ 'database_locked' ] ) : #NEWLINE# #INDENT# driver = databaseinfra . get_driver ( ) #NEWLINE# client = driver . get_client ( instance ) #NEWLINE# driver . unlock_database ( client ) #NEWLINE# #UNINDENT# if ( 'snapshopt_id' in workflow_dict ) : #NEWLINE# #INDENT# host_attr = HostAttr . objects . get ( host = instance . hostname , is_active = True ) #NEWLINE# NfsaasProvider . remove_snapshot ( environment = databaseinfra . environment , host_attr = host_attr , snapshot_id = self [ 'snapshopt_id' ] ) #NEWLINE# #UNINDENT# return True #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 ) #NEWLINE# return False