Antoni Segura Puimedon has uploaded a new change for review.
Change subject: netinfo: drop generally unused NetInfo.getNicBondings
......................................................................
netinfo: drop generally unused NetInfo.getNicBondings
getNicBondings was only used as a rather verbose convenience method
for getNicBonding. It is better to just have a simplified version
inside getNicBonding.
Change-Id: I8dc5c975dfab2917fe637012e31b3a83456f3c24
Signed-off-by: Antoni S. Puimedon <asegurap(a)redhat.com>
---
M lib/vdsm/netinfo.py
1 file changed, 2 insertions(+), 6 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/02/29602/1
diff --git a/lib/vdsm/netinfo.py b/lib/vdsm/netinfo.py
index a204f72..9deec88 100644
--- a/lib/vdsm/netinfo.py
+++ b/lib/vdsm/netinfo.py
@@ -930,17 +930,13 @@
if netdict['bridged'] and iface in netdict['ports']:
return bridge
- def getBondingsForNic(self, nic):
- for b, bdict in self.bondings.iteritems():
- if nic in bdict['slaves']:
- yield b
-
def getNicsForBonding(self, bond):
bondAttrs = self.bondings[bond]
return bondAttrs['slaves']
def getBondingForNic(self, nic):
- bondings = list(self.getBondingsForNic(nic))
+ bondings = [b for (b, attrs) in self.bondings.iteritems() if
+ nic in attrs['slaves']]
if bondings:
assert len(bondings) == 1, \
"Unexpected configuration: More than one bonding per nic"
--
To view, visit
http://gerrit.ovirt.org/29602
To unsubscribe, visit
http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I8dc5c975dfab2917fe637012e31b3a83456f3c24
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap(a)redhat.com>