yanne / api-test

0 stars 0 forks source link

`Execute Command` occasionally returns `None` instead of `0` as the exit status on Jython #69

Closed yanne closed 10 years ago

yanne commented 10 years ago

Hi,

I am using the Keyword “Execute Command” of SSH Library (trilead_sshlibrary). This is showing me an unexpected behavior when I run the code from RedHat Linux using jython. It returns a Return Code ‘None’ of type ‘NoneType’.

Return Codes should only be integers. I’m checking the Return Code to be Zero (0) just to validate if the command execution on remote host is successful. But ‘None’ is returned instead of Zero as RC, even if the Command has been executed successfully.

However, I couldn't reproduce the issue while using pybot.

This issue was originally opened at Google Code on Jun 10, 2013.

yanne commented 10 years ago

Original comment by pekka.klarck on Jul 31, 2013.

Apparently Trilead returns None as the RC in some cases when it should really return 0. It's hard to know for sure since this only happens sporadically and we have never seen this ourselves. It's nevertheless easy to add a check for None to place where the RC is got initially.

yanne commented 10 years ago

Original comment by anssi.sy...@eficode.com on Aug 1, 2013.

This should be fixed by https://code.google.com/p/robotframework-sshlibrary/source/detail?r=b3079a76de24a812a846bfe2624303596b3815ba .

someshmalimath: Please verify that the problem is now fixed.

yanne commented 10 years ago

Original comment by someshma...@gmail.com on Aug 2, 2013.

Thanks Anssi. I shall verify this. Please give me suggestions as to how this fix can be incorporated. Is it fine if I just update the "/src/SSHLibrary/javaclient.py" script on my machine?

yanne commented 10 years ago

Original comment by anssi.sy...@gmail.com on Aug 14, 2013.

The safest way is to clone the repository (git clone https://code.google.com/p/robotframework-sshlibrary/ ) to your machine and append /path/to/the/cloned/robotframework-sshlibrary/src to your PYTHONPATH (e.g. by using 'pybot -P /path/to/the/cloned/robotframework-sshlibrary/src ...').

yanne commented 10 years ago

Original comment by pekka.klarck on Oct 16, 2013.

Looks good to me.

yanne commented 10 years ago

Original comment by vesa.kal...@tieto.com on Apr 23, 2014.

It looks like that the 'none' rc is coming randomly also when the return code should be non-zero. The current fix will probably change the return code to 0 in those cases also.