Re: [Freeipa-devel] [patch]-pytest-multihost-Return File Attributes to sftp.put

2015-08-13 Thread Niranjan
Tomas Babej wrote:
> 
> 
> On 08/13/2015 01:55 PM, Niranjan wrote:
> > Greetings,
> > 
> > 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 transport.py 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.
> > 
> > Regards
> > Niranjan 
> > 
> > 
> > 
> 
> Note that ParamikoTransport is not the only kind of Transport class in
> the python-multihost. So using the FileAttributes to distinguish
> success/failure does not seem like the way to go.
> 
> If you want to distinguish between a successful/unsuccessful put_file
> call, we should return a boolean value, or rather raise an exception.
I agree, exception would be better approach.
> 
> Cc-ing Petr to chime in.
> 
> Tomas


pgp5vM3ecdiKc.pgp
Description: PGP signature
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Re: [Freeipa-devel] [patch]-pytest-multihost-Return File Attributes to sftp.put

2015-08-13 Thread Niranjan
Martin Basti wrote:
> 
> 
> On 08/13/2015 01:55 PM, Niranjan wrote:
> >Greetings,
> >
> >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 transport.py 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.
> >
> >Regards
> >Niranjan
> >
> >
> You mixed tabs and spaces, please use only spaces.
Sure, will use spaces here after. 


pgpOW4Z7Hp6a4.pgp
Description: PGP signature
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code

Re: [Freeipa-devel] [patch]-pytest-multihost-Return File Attributes to sftp.put

2015-08-13 Thread Tomas Babej


On 08/13/2015 01:55 PM, Niranjan wrote:
> Greetings,
> 
> 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 transport.py 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.
> 
> Regards
> Niranjan 
> 
> 
> 

Note that ParamikoTransport is not the only kind of Transport class in
the python-multihost. So using the FileAttributes to distinguish
success/failure does not seem like the way to go.

If you want to distinguish between a successful/unsuccessful put_file
call, we should return a boolean value, or rather raise an exception.

Cc-ing Petr to chime in.

Tomas

-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code


Re: [Freeipa-devel] [patch]-pytest-multihost-Return File Attributes to sftp.put

2015-08-13 Thread Martin Basti



On 08/13/2015 01:55 PM, Niranjan wrote:

Greetings,

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 transport.py 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.

Regards
Niranjan



You mixed tabs and spaces, please use only spaces.
-- 
Manage your subscription for the Freeipa-devel mailing list:
https://www.redhat.com/mailman/listinfo/freeipa-devel
Contribute to FreeIPA: http://www.freeipa.org/page/Contribute/Code