Skip to content
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

Add sftp=None support for creating SFTP channel to SSHClient.mkdir() #394

Open
snooter101 opened this issue Jun 26, 2024 · 0 comments
Open

Comments

@snooter101
Copy link

Is your feature request related to a problem? Please describe.
First try at using parallel-ssh and am trying to create a remote directory using SSHClient.mkdir().

The method requires the sftp parameter and doesn't allow None, while other similar methods (e.g. SSHClient.copy_file()) do.

I looked at the source and worked out what I needed to do (i.e. use the internal method _make_sftp()), but it would be nicer for it to be created on the fly.

Describe the solution you'd like
Default sftp=None for SSHClient.mkdir(), and when sftp=None, then use _make_sftp() to create the SFTP channel.

I realise this changes the API so might be something that needs to be changed in a later version.
Also, adding the same default sftp handling to other methods like sftp_get() and sftp_put() would simplify usage as well.

Describe alternatives you've considered
Used internal method to create SFTP channel.

Additional context
None.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant