Back to index

obnam  1.1
Classes | Functions | Variables
obnamlib.plugins.sftp_plugin Namespace Reference

Classes

class  SSHChannelAdapter
class  SftpFS
class  SftpPlugin

Functions

def ioerror_to_oserror

Variables

int DEFAULT_SSH_PORT = 22

Function Documentation

Decorator to convert an IOError exception to OSError.

Python's os.* raise OSError, mostly, but paramiko's corresponding
methods raise IOError. This decorator fixes that.

Definition at line 46 of file sftp_plugin.py.

00046 
00047 def ioerror_to_oserror(method):
00048     '''Decorator to convert an IOError exception to OSError.
00049     
00050     Python's os.* raise OSError, mostly, but paramiko's corresponding
00051     methods raise IOError. This decorator fixes that.
00052     
00053     '''
00054     
00055     def helper(self, filename, *args, **kwargs):
00056         try:
00057             return method(self, filename, *args, **kwargs)
00058         except IOError, e:
00059             raise OSError(e.errno, e.strerror or str(e), filename)
00060     
00061     return helper
00062 


Variable Documentation

Definition at line 43 of file sftp_plugin.py.