Change in vdsm[master]: refactoring: getMaxMtu updated implementation using max buil...
gvallare at redhat.com
gvallare at redhat.com
Wed May 15 12:00:35 UTC 2013
Giuseppe Vallarelli has uploaded a new change for review.
Change subject: refactoring: getMaxMtu updated implementation using max builtin.
......................................................................
refactoring: getMaxMtu updated implementation using max builtin.
Improvement to getMaxMtu implementation which now is more
succint by using max builtin function.
Change-Id: I2e3beef38675b2f74f2945247b8af1de3eeebc90
Signed-off-by: Giuseppe Vallarelli <gvallare at redhat.com>
---
M vdsm/netconf/ifcfg.py
1 file changed, 1 insertion(+), 5 deletions(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/43/14743/1
diff --git a/vdsm/netconf/ifcfg.py b/vdsm/netconf/ifcfg.py
index 58dc501..efa83e0 100644
--- a/vdsm/netconf/ifcfg.py
+++ b/vdsm/netconf/ifcfg.py
@@ -695,12 +695,8 @@
getMaxMtu return the highest value in a connection tree,
it check if a vlan, bond that have a higher mtu value
"""
- for nic in nics:
- mtuval = int(netinfo.getMtu(nic))
- if mtuval > mtu:
- mtu = mtuval
- return mtu
+ return max(mtu, *[int(netinfo.getMtu(nic)) for nic in nics])
def setNewMtu(self, network, bridged, _netinfo=None):
"""
--
To view, visit http://gerrit.ovirt.org/14743
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I2e3beef38675b2f74f2945247b8af1de3eeebc90
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Giuseppe Vallarelli <gvallare at redhat.com>
More information about the vdsm-patches
mailing list