#NEWLINE# def run_script( self , script , options = None ) : #NEWLINE# #INDENT# '\n        Run a script that logs messages and uses ``FlockerScriptRunner``.\n\n        :param ICommandLineScript: Script to run. Must be class in this module.\n        :param list options: Extra command line options to pass to the\n            script.\n\n        :return: ``Deferred`` that fires with list of decoded JSON messages.\n        ' #NEWLINE# if ( options is None ) : #NEWLINE# #INDENT# options = [ ] #NEWLINE# #UNINDENT# code = _SCRIPT_CODE . format ( script . __name__ , script . __name__ ) #NEWLINE# d = getProcessOutput ( sys . executable , ( [ b'-c' , code ] + options ) , env = os . environ , errortoo = True ) #NEWLINE# d . addCallback ( ( lambda data : ( msg ( ( b'script output: ' + data ) ) , data ) [ 1 ] ) ) #NEWLINE# d . addCallback ( ( lambda data : map ( loads , data . splitlines ( ) ) ) ) #NEWLINE# return d