Skip to content

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

Open
@snooter101

Description

@snooter101

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions