Change in vdsm[master]: ipwrapper: fix Link's fromText mtu and vlanid types

asegurap at redhat.com asegurap at redhat.com
Wed Jan 15 12:39:57 UTC 2014


Antoni Segura Puimedon has uploaded a new change for review.

Change subject: ipwrapper: fix Link's fromText mtu and vlanid types
......................................................................

ipwrapper: fix Link's fromText mtu and vlanid types

Accross the codebase mtu and vlanid are specified to be integers.
This patch makes sure that when we get the information from
parsing iproute2 the types are correct.

Change-Id: I1a27e443911d7828afacb28a9bd914b6da2cdc4b
Signed-off-by: Antoni S. Puimedon <asegurap at redhat.com>
---
M lib/vdsm/ipwrapper.py
M tests/functional/networkTests.py
2 files changed, 4 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/75/23275/1

diff --git a/lib/vdsm/ipwrapper.py b/lib/vdsm/ipwrapper.py
index 75f4ad9..f645b4f 100644
--- a/lib/vdsm/ipwrapper.py
+++ b/lib/vdsm/ipwrapper.py
@@ -146,6 +146,9 @@
             name, device = attrs['name'].split('@')
             attrs['name'] = name
             attrs['device'] = device
+        if 'vlanid' in attrs:
+            attrs['vlanid'] = int(attrs['vlanid'])
+        attrs['mtu'] = int(attrs['mtu'])
         return cls(**attrs)
 
     @staticmethod
diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py
index 9f8e50f..7be8506 100644
--- a/tests/functional/networkTests.py
+++ b/tests/functional/networkTests.py
@@ -1571,7 +1571,7 @@
     def testIpLinkWrapper(self):
         """Tests that the created devices are properly parsed by the ipwrapper
         Link class."""
-        BIG_MTU = '2000'
+        BIG_MTU = 2000
         VLAN_NAME = '%s.%s' % (BONDING_NAME, VLAN_ID)
         with dummyIf(2) as nics:
             status, msg = self.vdsm_net.setupNetworks(


-- 
To view, visit http://gerrit.ovirt.org/23275
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1a27e443911d7828afacb28a9bd914b6da2cdc4b
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap at redhat.com>


More information about the vdsm-patches mailing list