summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBala.FA <barumuga@redhat.com>2014-06-19 12:10:24 +0530
committerTimothy Asir <tim.gluster@gmail.com>2015-02-03 04:10:52 -0800
commite50562c747d951b2b7225819d2bfdc0ae38aaa44 (patch)
tree1f98fa648a2ef3ac50bc55cab61cb1c5454319eb
parent5f7c36599eab262a3dd3f5c42eeb89e53abadac8 (diff)
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 <barumuga@redhat.com> Reviewed-on: http://review.gluster.org/8111 Reviewed-by: Shubhendu Tripathi <shtripat@redhat.com> Reviewed-by: Kanagaraj M <kmayilsa@redhat.com> Reviewed-by: Timothy Asir <tim.gluster@gmail.com>
-rwxr-xr-xplugins/network.py3
1 files changed, 2 insertions, 1 deletions
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