<s> import logging <EOL> from util import full_stack <EOL> from util import call_script <EOL> from django . conf import settings <EOL> from drivers import factory_for <EOL> from notification . util import get_clone_args <EOL> from ... util . base import BaseStep <EOL> from ... . exceptions . error_codes import DBAAS_0017 <EOL> LOG = logging . getLogger ( __name__ ) <EOL> class CloneDatabase ( BaseStep ) : <EOL> def __unicode__ ( self ) : <EOL> return "<STR_LIT>" <EOL> def do ( self , workflow_dict ) : <EOL> try : <EOL> if '<STR_LIT>' not in workflow_dict or '<STR_LIT>' not in workflow_dict : <EOL> return False <EOL> args = get_clone_args ( <EOL> workflow_dict [ '<STR_LIT>' ] , workflow_dict [ '<STR_LIT>' ] ) <EOL> script_name = factory_for ( <EOL> workflow_dict [ '<STR_LIT>' ] . databaseinfra ) . clone ( ) <EOL> return_code , output = call_script ( <EOL> script_name , working_dir = settings . SCRIPTS_PATH , args = args , split_lines = False , ) <EOL> LOG . info ( "<STR_LIT>" . format ( output ) ) <EOL> LOG . info ( "<STR_LIT>" . format ( return_code ) ) <EOL> if return_code != <NUM_LIT:0> : <EOL> workflow_dict [ '<STR_LIT>' ] [ '<STR_LIT>' ] . append ( output ) <EOL> return False <EOL> return True <EOL> except Exception : <EOL> traceback = full_stack ( ) <EOL> workflow_dict [ '<STR_LIT>' ] [ '<STR_LIT>' ] . append ( DBAAS_0017 ) <EOL> workflow_dict [ '<STR_LIT>' ] [ '<STR_LIT>' ] . append ( traceback ) <EOL> return False <EOL> def undo ( self , workflow_dict ) : <EOL> LOG . info ( "<STR_LIT>" ) <EOL> return True </s>
