Repository navigation
Conversation
A new SFTP channel is created when sftp is None, as copy_file already does. Resolves ParallelSSH#394.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #432 +/- ##
==========================================
- Coverage 99.47% 99.41% -0.06%
==========================================
Files 18 18
Lines 1708 1711 +3
==========================================
+ Hits 1699 1701 +2
- Misses 9 10 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves #394.
SSHClient.copy_filealready creates an SFTP channel whensftpisNone, butmkdir,sftp_putandsftp_getrequired one, so users had to call the private_make_sftp()first.This PR makes those three methods (native client) accept
Noneforsftpand create a new channel in that case. The signatures are unchanged, so existing callers are not affected, andclient.mkdir(None, '/some/dir')now works. I keptsftppositional rather than giving it a default, since it comes beforedirectoryand moving it would be a breaking change; happy to change that if you prefer a keyword default in a future major version.Also adds a docstring to
sftp_get, a Changelog entry under 2.17.0, and two integration tests (test_sftp_mkdir_no_sftp,test_sftp_put_get_no_sftp) that fail on master and pass with the change.Tested locally against the embedded OpenSSH server: the sftp/copy/mkdir tests in
ci/integration_tests/libssh2_clients/test_single_client.pypass (the existingtest_sftp_openfh_excfails only because I ran as root, same on master). flake8 is clean.