From e50562c747d951b2b7225819d2bfdc0ae38aaa44 Mon Sep 17 00:00:00 2001 From: "Bala.FA" Date: Thu, 19 Jun 2014 12:10:24 +0530 Subject: plugins/network: fix interface up status This patch identifies interface's up status by additionally using IFF_RUNNING flag Change-Id: I26bd356065e9167196d09973aa378b00b589fcf2 Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1110804 Signed-off-by: Bala.FA Reviewed-on: http://review.gluster.org/8111 Reviewed-by: Shubhendu Tripathi Reviewed-by: Kanagaraj M Reviewed-by: Timothy Asir --- plugins/network.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/network.py b/plugins/network.py index c740514..920cee3 100755 --- a/plugins/network.py +++ b/plugins/network.py @@ -84,7 +84,8 @@ def _getStatMessage(stat, all=False, includes=(), excludes=()): for info in stat['network']['net-dev']: ipaddr = interfaces.get(info['iface'], {}).get('ipaddr') flags = interfaces.get(info['iface'], {}).get('flags') - if flags and (flags & ethtool.IFF_UP): + if flags and (flags & ethtool.IFF_UP) and \ + (flags & ethtool.IFF_RUNNING): status = InterfaceStatus.UP else: status = InterfaceStatus.DOWN -- cgit