Fix `isdir` checking inside of SFTP class #1147

Closed
wants to merge 1 commit into
from

Projects

None yet

2 participants

@ikalnytskyi
Contributor

We have to use stat instead of lstat inside isdir method, since the first one returns True even for symlinks to folders.

The fix is very important when we need to download some folder that contains a symlink to another one.

@ikalnytskyi ikalnytskyi Fix `isdir` checking inside of SFTP class
We have to use `stat` instead of `lstat` inside `isdir` method, since
the first one returns `True` even for symlinks to folders.

The fix is very important when we need to download some folder that
contains a symlink to another one.
6b8da46
@openstack-gerrit openstack-gerrit pushed a commit to openstack/fuel-web that referenced this pull request Jun 26, 2014
@ikalnytskyi ikalnytskyi Shotgun: make snapshot of entire /var/log
Shootgun uses a fabric.api.get method to download some folder from the
remote host. Unfortunately, this method has a bug and fails when we
trying to download a folder that contains a symlink to another one.

So we need to patch fabric api to prevent us from such falls. The issue
with fabric api is that it recognize all symlinks as a file. As a result
we fails when trying to download a folder (pointed by a symlink)  as
a file.

The patch was proposed to the fabric master branch and can be reviewed
here:

    fabric/fabric#1147

Closes-Bug: #1318514
Closes-Bug: #1323436

Change-Id: Ic2ae889337e5da15bbdf83338b8e8d5d913aeb63
9be3661
@bitprophet bitprophet added a commit that closed this pull request Aug 7, 2014
@bitprophet bitprophet Changelog, closes #1147 7cbd561
@bitprophet bitprophet closed this in 7cbd561 Aug 7, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment