Ondřej Svoboda has uploaded a new change for review.
Change subject: netinfo: Add shorthand NetInfo.bridges for consistency
......................................................................
netinfo: Add shorthand NetInfo.bridges for consistency
Change-Id: Ibf14be0a4db0678b4653512accd48b5ee9a43e1d
Signed-off-by: Ondřej Svoboda <osvoboda(a)redhat.com>
---
M lib/vdsm/netinfo.py
M tests/configNetworkTests.py
M tests/netmodelsTests.py
3 files changed, 4 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/12/25212/1
diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py
index 8c21392..9a9c29a 100644
--- a/lib/vdsm/netinfo.py
+++ b/lib/vdsm/netinfo.py
@@ -747,6 +747,7 @@
self.vlans = _netinfo['vlans']
self.nics = _netinfo['nics']
self.bondings = _netinfo['bondings']
+ self.bridges = _netinfo['bridges']
def updateDevices(self):
"""Updates the object device information while keeping the cached
@@ -756,6 +757,7 @@
self.vlans = _netinfo['vlans']
self.nics = _netinfo['nics']
self.bondings = _netinfo['bondings']
+ self.bridges = _netinfo['bridges']
def getNetworksAndVlansForIface(self, iface):
""" Returns tuples of (bridge/network, vlan) connected to
nic/bond """
diff --git a/tests/configNetworkTests.py b/tests/configNetworkTests.py
index a72fe96..8e6f37c 100644
--- a/tests/configNetworkTests.py
+++ b/tests/configNetworkTests.py
@@ -88,6 +88,7 @@
},
'nics': ['eth0', 'eth1', 'eth2',
'eth3', 'eth4', 'eth5', 'eth6',
'eth7', 'eth8', 'eth9', 'eth10'],
+ 'bridges': {},
'bondings': {'bond00': {'slaves': ['eth5',
'eth6']}}
}
diff --git a/tests/netmodelsTests.py b/tests/netmodelsTests.py
index 6181a9e..033b8d85 100644
--- a/tests/netmodelsTests.py
+++ b/tests/netmodelsTests.py
@@ -138,7 +138,7 @@
def testTextualRepr(self):
_netinfo = {'networks': {}, 'vlans': {},
'nics': ['testnic1', 'testnic2'],
- 'bondings': {}}
+ 'bondings': {}, 'bridges': {}}
fakeInfo = netinfo.NetInfo(_netinfo)
nic1 = Nic('testnic1', None, _netinfo=fakeInfo)
nic2 = Nic('testnic2', None, _netinfo=fakeInfo)
--
To view, visit
http://gerrit.ovirt.org/25212
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibf14be0a4db0678b4653512accd48b5ee9a43e1d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Ondřej Svoboda <osvoboda(a)redhat.com>