#NEWLINE# @ staticmethod #NEWLINE# def _execute_script( instance , script_path , script_text = None , user = 'root' , password = None ) : #NEWLINE# #INDENT# with instance . remote ( ) as r : #NEWLINE# #INDENT# if script_text : #NEWLINE# #INDENT# r . write_file_to ( script_path , script_text , run_as_root = True ) #NEWLINE# #UNINDENT# LOG . debug ( 'Executing SQL script {path}' . format ( path = script_path ) ) #NEWLINE# r . execute_command ( ( 'mysql %s %s < %s' % ( ( ( '-u' + user ) if user else '' ) , ( ( '-p' + password ) if password else '' ) , script_path ) ) , run_as_root = True )