-
Notifications
You must be signed in to change notification settings - Fork 224
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SshTransport.gettree
: allow non-existing nested target directories
#4175
SshTransport.gettree
: allow non-existing nested target directories
#4175
Conversation
The `gettree` method would raise an `OSError` for the `SshTransport` if the target local path contains intermediate subdirectories that are not created beforehand. The same would work without problem for the `LocalTransport` plugin. It makes sense to just create non-existing directories along the way, so the `os.mkdir` command that was used originally to create the target directory is replaced with the method `os.makedirs` setting `exists_ok=True`.
It is interesting that this went unnoticed. This came up during development of the |
Codecov Report
@@ Coverage Diff @@
## develop #4175 +/- ##
===========================================
- Coverage 78.89% 78.88% -0.00%
===========================================
Files 467 467
Lines 34470 34470
===========================================
- Hits 27191 27189 -2
- Misses 7279 7281 +2
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good to go for me!
The only thing is that when I try to test the transport locally I keep running into problems. This is clearly my issue because the test pass on the CI and this also happened before when I was trying to do some modifications in the transport, but do you have any idea of what may it be? I think all of the tests get the same error:
(test the transport locally = pytest run the |
Seems like you might have a problem with the configuration of the openssh-server on your localhost. We are testing the |
Thanks for the review. Let's wait with merging until @giovannipizzi has had a look to make sure I am not patching a problem that has its origin elsewhere |
Fixes #4174
The
gettree
method would raise anOSError
for theSshTransport
ifthe target local path contains intermediate subdirectories that are not
created beforehand. The same would work without problem for the
LocalTransport
plugin. It makes sense to just create non-existingdirectories along the way, so the
os.mkdir
command that was usedoriginally to create the target directory is replaced with the method
os.makedirs
settingexists_ok=True
.