#NEWLINE# def convert_paramiko_errors( method ) : #NEWLINE# #INDENT# 'Convert remote Paramiko errors to errors.RemoteError' #NEWLINE# def wrapper( self , * args , **kw ) : #NEWLINE# #INDENT# try : #NEWLINE# #INDENT# return method ( self , * args , ** kw ) #NEWLINE# #UNINDENT# except IOError as error : #NEWLINE# #INDENT# if ( error . errno == errno . ENOENT ) : #NEWLINE# #INDENT# raise errors . RemoteFileDoesNotExist ( str ( error ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# raise errors . RemoteError ( ( '%s: %s' % ( error . __class__ . __name__ , error ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# except ( socket . error , paramiko . SSHException , EOFError ) as error : #NEWLINE# #INDENT# raise errors . RemoteError ( ( '%s: %s' % ( error . __class__ . __name__ , error ) ) ) #NEWLINE# #UNINDENT# #UNINDENT# wrapper . __doc__ = method . __doc__ #NEWLINE# wrapper . __name__ = method . __name__ #NEWLINE# return wrapper