pyworkflow.utils.remote module¶
This modules contains some wrappers over the ssh paramiko library to provide handling functions on remote hosts through ssh.
Main classes are:
- RemotePath: this class use an ssh/sftp connection to mimic the
- functions in utils.path but remotely and provides basic file transfer
-
class
pyworkflow.utils.remote.
RemotePath
(ssh)[source]¶ Bases:
object
This class will server as a Wrapper to the paramiko sftp protocol through a ssh connection. This class will implement useful methods for remote path handling such as: creating files, deleting folders…
-
cleanPath
(*remotePaths)[source]¶ Same as pyworkflow.utils.path.cleanPath but for remote folders or files.
-
copyTree
(localFolder, remoteFolder)[source]¶ Same as shutil.copytree, but allowing that the dest folder also exists. dest is a remote folder.
-
-
pyworkflow.utils.remote.
sshConnect
(hostName, userName, password, port=22, **args)[source]¶ Common way to create a ssh connection. Params:
hostName: Remote host name. userName: User name. password: Password. port: port to establish connection (usually 22)Returns: ssh connection handler.