This patch is regarding pytest-multihost plugin. 
Including a patch to return FileAttributes for sftp.put function
used in the function.

Current put_file function in in ParamikoTransport Class doesn't
return any value. So when using this function it's not clear if the operation
was sucessfull or not. 

Returning FileAttributes to put_file function helps in checking if operation
was indeed succesful. 

Requesting feedback on the patch attached.

From 5268b93efec39fc0c04f5bd022497143622e87b4 Mon Sep 17 00:00:00 2001
From: Niranjan MR <>
Date: Thu, 13 Aug 2015 17:02:45 +0530
Subject: [PATCH] Return File Attributes to sftp.put

This patch passes argument confirm=True to
sftp.put function to return file attributes
of destination file.

Also put_file function now returns FileAttributes
of type SFTPAttributes

Signed-off-by: Niranjan MR <>
 pytest_multihost/ | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/pytest_multihost/ b/pytest_multihost/
--- a/pytest_multihost/
+++ b/pytest_multihost/
@@ -244,7 +244,8 @@ class ParamikoTransport(Transport):
     def put_file(self, localpath, remotepath):'PUT %s', remotepath)
-        self.sftp.put(localpath, remotepath)
+        fileAttributes = self.sftp.put(localpath, remotepath,confirm=True)
+       return fileAttributes
 class OpenSSHTransport(Transport):

Attachment: pgpHHmGGzMTJr.pgp
Description: PGP signature

Manage your subscription for the Freeipa-devel mailing list:
Contribute to FreeIPA:

Reply via email to