On 08/21/2014 10:54 AM, CrÃstian Viana wrote:
On 20-08-2014 11:58, Ramon Medeiros wrote:
> LTC Bugzilla #115031 - LTCTest: build-8: List interfaces which are
> active
>
> The old way does just consider if the interface has connectivity, not
> the interface status. The new file can determine if the interface is up
> or down and if cable is connected or not.
>
> Signed-off-by: Ramon Medeiros <ramonn(a)linux.vnet.ibm.com>
There are trailing white spaces in your patch. Please remove them.
> + # try to read interface status
> + try:
> + status = open(NET_STATE % dev).readline().strip()
> + except IOError:
> + pass
> +
> + # when IOError is raised, interface is down
> + if status == None:
> + return "down"
If you want to return "down" when IOError is raised, do it inside the
"except IOError" block (which actually exists but does nothing). I
know both codes are similar, but the one in this patch is less clear.
ok, i resent the patch
--
Ramon Nunes Medeiros
RHEV-H Blue for Troy & Sparta Focal Point
Software Engineer - Linux Technology Center Brazil
IBM Systems & Technology Group
Phone : +55 19 2132 7878
ramonn(a)br.ibm.com