Hunt Xu has uploaded a new change for review.
Change subject: network: reuse netinfo.ports()
......................................................................
network: reuse netinfo.ports()
Change-Id: I77e542cb0982e792e29d092f9e911cf74d910d36
Signed-off-by: huntxu <mhuntxu(a)gmail.com>
---
M vdsm/configNetwork.py
M vdsm/netinfo.py
2 files changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/03/12503/1
diff --git a/vdsm/configNetwork.py b/vdsm/configNetwork.py
index 2470419..72d1354 100755
--- a/vdsm/configNetwork.py
+++ b/vdsm/configNetwork.py
@@ -989,7 +989,7 @@
def assertBridgeClean(bridge, vlan, bonding, nics):
- brifs = os.listdir('/sys/class/net/%s/brif/' % bridge)
+ brifs = netinfo.ports(bridge)
for nic in nics:
try:
brifs.remove(nic)
diff --git a/vdsm/netinfo.py b/vdsm/netinfo.py
index fadc86e..56999b5 100644
--- a/vdsm/netinfo.py
+++ b/vdsm/netinfo.py
@@ -195,7 +195,7 @@
def graph():
for bridge in bridges():
print bridge
- for iface in os.listdir('/sys/class/net/' + bridge + '/brif'):
+ for iface in ports(bridge):
print '\t' + iface
if iface in vlans():
iface = iface.split('.')[0]
@@ -211,7 +211,7 @@
raise ValueError('unknown bridge %s' % bridge)
vlan = bonding = ''
nics = []
- for iface in os.listdir('/sys/class/net/' + bridge + '/brif'):
+ for iface in ports(bridge):
if iface in vlans():
iface, vlan = iface.split('.')
if iface in bondings():
--
To view, visit
http://gerrit.ovirt.org/12503
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I77e542cb0982e792e29d092f9e911cf74d910d36
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Hunt Xu <mhuntxu(a)gmail.com>