Back to index

obnam  1.1
Public Member Functions | Public Attributes | Static Public Attributes | Private Member Functions | Private Attributes
obnamlib.plugins.sftp_plugin.SftpFS Class Reference
Inheritance diagram for obnamlib.plugins.sftp_plugin.SftpFS:
Inheritance graph
[legend]
Collaboration diagram for obnamlib.plugins.sftp_plugin.SftpFS:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def log_stats
def connect
def close
def reinit
def getcwd
def chdir
def listdir
def listdir2
def lock
def unlock
def exists
def isdir
def mknod
def mkdir
def makedirs
def rmdir
def remove
def rename
def lstat
def lchown
def chmod
def lutimes
def link
def readlink
def symlink
def open
def cat
def write_file
def overwrite_file

Public Attributes

 sftp
 settings
 create_path_if_missing
 transport
 host
 port
 user
 path
 lutimes_warned

Static Public Attributes

int chunk_size = 32

Private Member Functions

def _delay
def _to_string
def _create_root_if_missing
def _connect_openssh
def _connect_paramiko
def _check_host_key
def _authenticate
def _find_auth_keys
def _load_from_key_file
def _load_from_agent
def _get_username
def _force_32bit_timestamp
def _fix_stat
def _remove_if_exists
def _tempfile
def _write_helper

Private Attributes

 _roundtrips

Detailed Description

A VFS implementation for SFTP.

Definition at line 99 of file sftp_plugin.py.


Constructor & Destructor Documentation

def obnamlib.plugins.sftp_plugin.SftpFS.__init__ (   self,
  baseurl,
  create = False,
  settings = None 
)

Definition at line 111 of file sftp_plugin.py.

00111 
00112     def __init__(self, baseurl, create=False, settings=None):
00113         obnamlib.VirtualFileSystem.__init__(self, baseurl)
00114         self.sftp = None
00115         self.settings = settings
00116         self._roundtrips = 0
00117         self.reinit(baseurl, create=create)


Member Function Documentation

def obnamlib.plugins.sftp_plugin.SftpFS._authenticate (   self,
  username 
) [private]

Definition at line 231 of file sftp_plugin.py.

00231 
00232     def _authenticate(self, username):
00233         for key in self._find_auth_keys():
00234             try:
00235                 self.transport.auth_publickey(username, key)
00236                 return
00237             except paramiko.SSHException:
00238                 pass
00239         raise obnamlib.Error('Can\'t authenticate to SSH server using key.')

Here is the call graph for this function:

Here is the caller graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS._check_host_key (   self,
  hostname 
) [private]

Definition at line 200 of file sftp_plugin.py.

00200 
00201     def _check_host_key(self, hostname):
00202         logging.debug('checking ssh host key for %s' % hostname)
00203 
00204         offered_key = self.transport.get_remote_server_key()
00205 
00206         known_hosts_path = self.settings['ssh-known-hosts']
00207         known_hosts = paramiko.util.load_host_keys(known_hosts_path)
00208 
00209         known_keys = known_hosts.lookup(hostname)
00210         if known_keys is None:
00211             if self.settings['strict-ssh-host-keys']:
00212                 raise obnamlib.Error('No known host key for %s' % hostname)
00213             logging.warning('No known host keys for %s; accepting offered key'
00214                             % hostname)
00215             return
00216 
00217         offered_type = offered_key.get_name()
00218         if not known_keys.has_key(offered_type):
00219             if self.settings['strict-ssh-host-keys']:
00220                 raise obnamlib.Error('No known type %s host key for %s' % 
00221                                      (offered_type, hostname))
00222             logging.warning('No known host key of type %s for %s; accepting '
00223                             'offered key' % (offered_type, hostname))
00224         
00225         known_key = known_keys[offered_type]
00226         if offered_key != known_key:
00227             raise obnamlib.Error('SSH server %s offered wrong public key' %
00228                                  hostname)
00229             
00230         logging.debug('Host key for %s OK' % hostname)        
    

Here is the caller graph for this function:

Definition at line 153 of file sftp_plugin.py.

00153 
00154     def _connect_openssh(self):
00155         args = ['ssh',
00156                 '-oForwardX11=no', '-oForwardAgent=no',
00157                 '-oClearAllForwardings=yes', '-oProtocol=2',
00158                 '-p', str(self.port),
00159                 '-l', self.user,
00160                 '-s']
00161         if self.settings and self.settings['ssh-key']:
00162             args += ['-i', self.settings['ssh-key']]
00163         if self.settings and self.settings['strict-ssh-host-keys']:
00164             args += ['-o', 'StrictHostKeyChecking=yes']
00165         if self.settings and self.settings['ssh-known-hosts']:
00166             args += ['-o', 
00167                      'UserKnownHostsFile=%s' % 
00168                         self.settings['ssh-known-hosts']]
00169         args += [self.host, 'sftp']
00170 
00171         logging.debug('executing openssh: %s' % args)
00172         try:
00173             proc = subprocess.Popen(args,
00174                                     stdin=subprocess.PIPE,
00175                                     stdout=subprocess.PIPE,
00176                                     close_fds=True)
00177         except OSError:
00178             return False
00179 
00180         self.transport = None
00181         self.sftp = paramiko.SFTPClient(SSHChannelAdapter(proc))
00182         return True

Here is the caller graph for this function:

Definition at line 183 of file sftp_plugin.py.

00183 
00184     def _connect_paramiko(self):
00185         logging.debug('connect_paramiko: host=%s port=%s' % (self.host, self.port))
00186         self.transport = paramiko.Transport((self.host, self.port))
00187         self.transport.connect()
00188         logging.debug('connect_paramiko: connected')
00189         try:
00190             self._check_host_key(self.host)
00191         except BaseException, e:
00192             self.transport.close()
00193             self.transport = None
00194             raise
00195         logging.debug('connect_paramiko: host key checked')
00196         self._authenticate(self.user)
00197         logging.debug('connect_paramiko: authenticated')
00198         self.sftp = paramiko.SFTPClient.from_transport(self.transport)
00199         logging.debug('connect_paramiko: end')

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 136 of file sftp_plugin.py.

00136 
00137     def _create_root_if_missing(self):
00138         try:
00139             self.mkdir(self.path)
00140         except OSError, e:
00141             # sftp/paramiko does not give us a useful errno so we hope
00142             # for the best
00143             pass
00144         self.create_path_if_missing = False # only create once
        

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 118 of file sftp_plugin.py.

00118 
00119     def _delay(self):
00120         self._roundtrips += 1
00121         if self.settings:
00122             ms = self.settings['sftp-delay']
00123             if ms > 0:
00124                 time.sleep(ms * 0.001)

Here is the caller graph for this function:

Definition at line 240 of file sftp_plugin.py.

00240 
00241     def _find_auth_keys(self):
00242         if self.settings and self.settings['ssh-key']:
00243             return [self._load_from_key_file(self.settings['ssh-key'])]
00244         else:
00245             return self._load_from_agent()

Here is the call graph for this function:

Here is the caller graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS._fix_stat (   self,
  pathname,
  st 
) [private]

Definition at line 332 of file sftp_plugin.py.

00332 
00333     def _fix_stat(self, pathname, st):
00334         # SFTP and/or paramiko fail to return some of the required fields,
00335         # so we add them, using faked data.
00336         defaults = {
00337             'st_blocks': (st.st_size / 512) +
00338                          (1 if st.st_size % 512 else 0),
00339             'st_dev': 0,
00340             'st_ino': int(hashlib.md5(pathname).hexdigest()[:8], 16),
00341             'st_nlink': 1,
00342         }
00343         for name, value in defaults.iteritems():
00344             if not hasattr(st, name):
00345                 setattr(st, name, value)
00346 
00347         # Paramiko seems to deal with unsigned timestamps only, at least
00348         # in version 1.7.6. We therefore force the timestamps into
00349         # a signed 32-bit value. This limits the range, but allows
00350         # timestamps that are negative (before 1970). Once paramiko is
00351         # fixed, this code can be removed.
00352         st.st_mtime_sec = self._force_32bit_timestamp(st.st_mtime)
00353         st.st_atime_sec = self._force_32bit_timestamp(st.st_atime)
00354         
00355         # Within Obnam, we pretend stat results have st_Xtime_sec and
00356         # st_Xtime_nsec, but not st_Xtime. Remove those fields.
00357         del st.st_mtime
00358         del st.st_atime
00359         
00360         # We only get integer timestamps, so set these explicitly to 0.
00361         st.st_mtime_nsec = 0
00362         st.st_atime_nsec = 0
00363 
00364         return st        

Here is the call graph for this function:

Here is the caller graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS._force_32bit_timestamp (   self,
  timestamp 
) [private]

Definition at line 321 of file sftp_plugin.py.

00321 
00322     def _force_32bit_timestamp(self, timestamp):
00323         if timestamp is None:
00324             return None
00325 
00326         max_int32 = 2**31 - 1 # max positive 32 signed integer value
00327         if timestamp > max_int32:
00328             timestamp -= 2**32
00329             if timestamp > max_int32:
00330                 timestamp = max_int32 # it's too large, need to lose info
00331         return timestamp

Here is the caller graph for this function:

Definition at line 304 of file sftp_plugin.py.

00304 
00305     def _get_username(self):
00306         return pwd.getpwuid(os.getuid()).pw_name

Here is the caller graph for this function:

Definition at line 255 of file sftp_plugin.py.

00255 
00256     def _load_from_agent(self):
00257         agent = paramiko.Agent()
00258         return agent.get_keys()

Here is the caller graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS._load_from_key_file (   self,
  filename 
) [private]

Definition at line 246 of file sftp_plugin.py.

00246 
00247     def _load_from_key_file(self, filename):
00248         try:
00249             key = paramiko.RSAKey.from_private_key_file(filename)
00250         except paramiko.PasswordRequiredException:
00251             password = getpass.getpass('RSA key password for %s: ' %
00252                                         filename)
00253             key = paramiko.RSAKey.from_private_key_file(filename, password)
00254         return key

Here is the caller graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS._remove_if_exists (   self,
  pathname 
) [private]
Like remove, but OK if file does not exist.

Definition at line 427 of file sftp_plugin.py.

00427 
00428     def _remove_if_exists(self, pathname):
00429         '''Like remove, but OK if file does not exist.'''
00430         try:
00431             self.remove(pathname)
00432         except OSError, e:
00433             if e.errno != errno.ENOENT:
00434                 raise

Here is the call graph for this function:

Here is the caller graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS._tempfile (   self,
  dirname 
) [private]
Create a new file with a random name, return file handle and name.

Definition at line 519 of file sftp_plugin.py.

00519 
00520     def _tempfile(self, dirname):
00521         '''Create a new file with a random name, return file handle and name.'''
00522         
00523         if dirname:
00524             try:
00525                 self.makedirs(dirname)
00526             except OSError:
00527                 # We ignore the error, on the assumption that it was due
00528                 # to the directory already existing. If it didn't exist
00529                 # and the error was for something else, then we'll catch
00530                 # that when we open the file for writing.
00531                 pass
00532 
00533         while True:
00534             i = random.randint(0, 2**64-1)
00535             basename = 'tmp.%x' % i
00536             pathname = os.path.join(dirname, basename)
00537             try:
00538                 f = self.open(pathname, 'wx', bufsize=self.chunk_size)
00539             except OSError:
00540                 pass
00541             else:
00542                 return f, pathname

Here is the call graph for this function:

Here is the caller graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS._to_string (   self,
  str_or_unicode 
) [private]

Definition at line 130 of file sftp_plugin.py.

00130 
00131     def _to_string(self, str_or_unicode):
00132         if type(str_or_unicode) is unicode:
00133             return str_or_unicode.encode('utf-8')
00134         else:
00135             return str_or_unicode

Here is the caller graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS._write_helper (   self,
  f,
  contents 
) [private]

Definition at line 552 of file sftp_plugin.py.

00552 
00553     def _write_helper(self, f, contents):
00554         for pos in range(0, len(contents), self.chunk_size):
00555             chunk = contents[pos:pos + self.chunk_size]
00556             f.write(chunk)
00557             self.bytes_written += len(chunk)
00558 

Here is the caller graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS.cat (   self,
  pathname 
)

Definition at line 491 of file sftp_plugin.py.

00491 
00492     def cat(self, pathname):
00493         self._delay()
00494         f = self.open(pathname, 'r')
00495         f.prefetch()
00496         chunks = []
00497         while True:
00498             chunk = f.read(self.chunk_size)
00499             if not chunk:
00500                 break
00501             chunks.append(chunk)
00502             self.bytes_read += len(chunk)
00503         f.close()
00504         return ''.join(chunks)

Here is the call graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS.chdir (   self,
  pathname 
)

Definition at line 312 of file sftp_plugin.py.

00312 
00313     def chdir(self, pathname):
00314         self._delay()
00315         self.sftp.chdir(pathname)

Here is the call graph for this function:

Here is the caller graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS.chmod (   self,
  pathname,
  mode 
)

Definition at line 457 of file sftp_plugin.py.

00457 
00458     def chmod(self, pathname, mode):
00459         self._delay()
00460         self.sftp.chmod(pathname, mode)
        

Here is the call graph for this function:

Definition at line 259 of file sftp_plugin.py.

00259 
00260     def close(self):
00261         logging.debug('SftpFS.close called')
00262         self.sftp.close()
00263         self.sftp = None
00264         if self.transport:
00265             self.transport.close()
00266             self.transport = None
00267         obnamlib.VirtualFileSystem.close(self)
00268         self._delay()

Here is the call graph for this function:

Definition at line 145 of file sftp_plugin.py.

00145 
00146     def connect(self):
00147         try_openssh = not self.settings or not self.settings['pure-paramiko']
00148         if not try_openssh or not self._connect_openssh():
00149             self._connect_paramiko()
00150         if self.create_path_if_missing:
00151             self._create_root_if_missing()
00152         self.chdir(self.path)

Here is the call graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS.exists (   self,
  pathname 
)

Definition at line 382 of file sftp_plugin.py.

00382 
00383     def exists(self, pathname):
00384         try:
00385             self.lstat(pathname)
00386         except OSError:
00387             return False
00388         else:
00389             return True

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 307 of file sftp_plugin.py.

00307 
00308     def getcwd(self):
00309         self._delay()
00310         return self._to_string(self.sftp.getcwd())

Here is the call graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS.isdir (   self,
  pathname 
)

Definition at line 390 of file sftp_plugin.py.

00390 
00391     def isdir(self, pathname):
00392         self._delay()
00393         try:
00394             st = self.lstat(pathname)
00395         except OSError:
00396             return False
00397         else:
00398             return stat.S_ISDIR(st.st_mode)

Here is the call graph for this function:

Here is the caller graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS.lchown (   self,
  pathname,
  uid,
  gid 
)

Definition at line 449 of file sftp_plugin.py.

00449 
00450     def lchown(self, pathname, uid, gid):
00451         self._delay()
00452         if stat.S_ISLNK(self.lstat(pathname).st_mode):
00453             logging.warning('NOT changing ownership of symlink %s' % pathname)
00454         else:
00455             self.sftp.chown(pathname, uid, gid)
        

Here is the call graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS.link (   self,
  existing_path,
  new_path 
)

Definition at line 475 of file sftp_plugin.py.

00475 
00476     def link(self, existing_path, new_path):
00477         raise obnamlib.Error('Cannot hardlink on SFTP. Sorry.')

def obnamlib.plugins.sftp_plugin.SftpFS.listdir (   self,
  pathname 
)

Definition at line 317 of file sftp_plugin.py.

00317 
00318     def listdir(self, pathname):
00319         self._delay()
00320         return [self._to_string(x) for x in self.sftp.listdir(pathname)]

Here is the call graph for this function:

Here is the caller graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS.listdir2 (   self,
  pathname 
)

Definition at line 366 of file sftp_plugin.py.

00366 
00367     def listdir2(self, pathname):
00368         self._delay()
00369         attrs = self.sftp.listdir_attr(pathname)
00370         pairs = [(self._to_string(st.filename), st) for st in attrs]
00371         fixed = [(name, self._fix_stat(name, st)) for name, st in pairs]
00372         return fixed

Here is the call graph for this function:

Here is the caller graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS.lock (   self,
  lockname,
  data 
)

Definition at line 373 of file sftp_plugin.py.

00373 
00374     def lock(self, lockname, data):
00375         try:
00376             self.write_file(lockname, data)
00377         except OSError, e:
00378             raise obnamlib.LockFail('Failure get lock %s' % lockname)

Here is the call graph for this function:

Definition at line 125 of file sftp_plugin.py.

00125 
00126     def log_stats(self):
00127         obnamlib.VirtualFileSystem.log_stats(self)
00128         logging.info('VFS: baseurl=%s roundtrips=%s' %
00129                          (self.baseurl, self._roundtrips))
        
def obnamlib.plugins.sftp_plugin.SftpFS.lstat (   self,
  pathname 
)

Definition at line 442 of file sftp_plugin.py.

00442 
00443     def lstat(self, pathname):
00444         self._delay()
00445         st = self.sftp.lstat(pathname)
00446         self._fix_stat(pathname, st)
00447         return st

Here is the call graph for this function:

Here is the caller graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS.lutimes (   self,
  pathname,
  atime_sec,
  atime_nsec,
  mtime_sec,
  mtime_nsec 
)

Definition at line 462 of file sftp_plugin.py.

00462 
00463     def lutimes(self, pathname, atime_sec, atime_nsec, mtime_sec, mtime_nsec):
00464         # FIXME: This does not work for symlinks!
00465         # Sftp does not have a way of doing that. This means if the restore
00466         # target is over sftp, symlinks and their targets will have wrong
00467         # mtimes.
00468         self._delay()
00469         if getattr(self, 'lutimes_warned', False):
00470             logging.warning('lutimes used over SFTP, this does not work '
00471                             'against symlinks (warning appears only first '
00472                             'time)')
00473             self.lutimes_warned = True
00474         self.sftp.utime(pathname, (atime_sec, mtime_sec))

Here is the call graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS.makedirs (   self,
  pathname 
)

Definition at line 411 of file sftp_plugin.py.

00411 
00412     def makedirs(self, pathname):
00413         parent = os.path.dirname(pathname)
00414         if parent and parent != pathname and not self.exists(parent):
00415             self.makedirs(parent)
00416         self.mkdir(pathname)

Here is the call graph for this function:

Here is the caller graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS.mkdir (   self,
  pathname 
)

Definition at line 406 of file sftp_plugin.py.

00406 
00407     def mkdir(self, pathname):
00408         self._delay()
00409         self.sftp.mkdir(pathname)
        

Here is the call graph for this function:

Here is the caller graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS.mknod (   self,
  pathname,
  mode 
)

Definition at line 399 of file sftp_plugin.py.

00399 
00400     def mknod(self, pathname, mode):
00401         # SFTP does not provide an mknod, so we can't do this. We 
00402         # raise an exception, so upper layers can handle this (we _could_
00403         # just fail silently, but that would be silly.)
00404         raise NotImplementedError('mknod on SFTP: %s' % pathname)

def obnamlib.plugins.sftp_plugin.SftpFS.open (   self,
  pathname,
  mode,
  bufsize = -1 
)

Definition at line 487 of file sftp_plugin.py.

00487 
00488     def open(self, pathname, mode, bufsize=-1):
00489         self._delay()
00490         return self.sftp.file(pathname, mode, bufsize=bufsize)

Here is the call graph for this function:

Here is the caller graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS.overwrite_file (   self,
  pathname,
  contents 
)

Definition at line 544 of file sftp_plugin.py.

00544 
00545     def overwrite_file(self, pathname, contents):
00546         self._delay()
00547         dirname = os.path.dirname(pathname)
00548         f, tempname = self._tempfile(dirname)
00549         self._write_helper(f, contents)
00550         f.close()
00551         self.rename(tempname, pathname)
        

Here is the call graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS.readlink (   self,
  symlink 
)

Definition at line 478 of file sftp_plugin.py.

00478 
00479     def readlink(self, symlink):
00480         self._delay()
00481         return self._to_string(self.sftp.readlink(symlink))

Here is the call graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS.reinit (   self,
  baseurl,
  create = False 
)

Definition at line 270 of file sftp_plugin.py.

00270 
00271     def reinit(self, baseurl, create=False):
00272         scheme, netloc, path, query, fragment = urlparse.urlsplit(baseurl)
00273 
00274         if scheme != 'sftp':
00275             raise obnamlib.Error('SftpFS used with non-sftp URL: %s' % baseurl)
00276 
00277         if '@' in netloc:
00278             user, netloc = netloc.split('@', 1)
00279         else:
00280             user = self._get_username()
00281 
00282         if ':' in netloc:
00283             host, port = netloc.split(':', 1)
00284             port = int(port)
00285         else:
00286             host = netloc
00287             port = DEFAULT_SSH_PORT
00288 
00289         if path.startswith('/~/'):
00290             path = path[3:]
00291 
00292         self.host = host
00293         self.port = port
00294         self.user = user
00295         self.path = path
00296         self.create_path_if_missing = create
00297 
00298         self._delay()
00299         
00300         if self.sftp:
00301             if create:
00302                 self._create_root_if_missing()
00303             self.sftp.chdir(path)

Here is the call graph for this function:

Here is the caller graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS.remove (   self,
  pathname 
)

Definition at line 423 of file sftp_plugin.py.

00423 
00424     def remove(self, pathname):
00425         self._delay()
00426         self.sftp.remove(pathname)

Here is the call graph for this function:

Here is the caller graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS.rename (   self,
  old,
  new 
)

Definition at line 436 of file sftp_plugin.py.

00436 
00437     def rename(self, old, new):
00438         self._delay()
00439         self._remove_if_exists(new)
00440         self.sftp.rename(old, new)
    

Here is the call graph for this function:

Here is the caller graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS.rmdir (   self,
  pathname 
)

Definition at line 418 of file sftp_plugin.py.

00418 
00419     def rmdir(self, pathname):
00420         self._delay()
00421         self.sftp.rmdir(pathname)
        

Here is the call graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS.symlink (   self,
  source,
  destination 
)

Definition at line 483 of file sftp_plugin.py.

00483 
00484     def symlink(self, source, destination):
00485         self._delay()
00486         self.sftp.symlink(source, destination)

Here is the call graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS.unlock (   self,
  lockname 
)

Definition at line 379 of file sftp_plugin.py.

00379 
00380     def unlock(self, lockname):
00381         self._remove_if_exists(lockname)

Here is the call graph for this function:

def obnamlib.plugins.sftp_plugin.SftpFS.write_file (   self,
  pathname,
  contents 
)

Definition at line 506 of file sftp_plugin.py.

00506 
00507     def write_file(self, pathname, contents):
00508         try:
00509             f = self.open(pathname, 'wx')
00510         except (IOError, OSError), e:
00511             if e.errno != errno.ENOENT:
00512                 raise
00513             dirname = os.path.dirname(pathname)
00514             self.makedirs(dirname)
00515             f = self.open(pathname, 'wx')
00516 
00517         self._write_helper(f, contents)
00518         f.close()

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 115 of file sftp_plugin.py.

Definition at line 109 of file sftp_plugin.py.

Definition at line 143 of file sftp_plugin.py.

Definition at line 291 of file sftp_plugin.py.

Definition at line 472 of file sftp_plugin.py.

Definition at line 294 of file sftp_plugin.py.

Definition at line 292 of file sftp_plugin.py.

Definition at line 114 of file sftp_plugin.py.

Definition at line 113 of file sftp_plugin.py.

Definition at line 179 of file sftp_plugin.py.

Definition at line 293 of file sftp_plugin.py.


The documentation for this class was generated from the following file: