def _run_scp(self): assert len(self.commands) == 1 args = self._parse_scp(self.commands[0]) args.check_fields() client = SSH( args.server, args.username, password=self.ssh_password, pkey_path=args.pkey, pkey_password=self.pkey_password) # TODO support different keys if args.put: client.scp_upload(args.file, remote_path=args.remote_path, recursive=args.r) else: client.scp_download(args.remote_path, recursive=args.r, local_path=args.file)