#NEWLINE# def run( self , command_line , user_io = None , ignore_error = False ) : #NEWLINE# #INDENT# ' run a single command as in the command line.\n            If user or password is filled, user_io will be mocked to return this\n            tuple if required\n        ' #NEWLINE# self . init_dynamic_vars ( user_io ) #NEWLINE# command = Command ( self . paths , self . user_io , self . runner , self . remote_manager ) #NEWLINE# args = shlex . split ( command_line ) #NEWLINE# current_dir = os . getcwd ( ) #NEWLINE# os . chdir ( self . current_folder ) #NEWLINE# try : #NEWLINE# #INDENT# error = command . run ( args ) #NEWLINE# #UNINDENT# finally : #NEWLINE# #INDENT# os . chdir ( current_dir ) #NEWLINE# #UNINDENT# if ( ( not ignore_error ) and error ) : #NEWLINE# #INDENT# logger . error ( self . user_io . out ) #NEWLINE# raise Exception ( ( 'Command failed:\n%s' % command_line ) ) #NEWLINE# #UNINDENT# return error