Change in vdsm[ovirt-3.6]: network: caps vlan vlanid property has to be int

phoracek at redhat.com phoracek at redhat.com
Wed Dec 23 14:12:38 UTC 2015


Petr Horáček has uploaded a new change for review.

Change subject: network: caps vlan vlanid property has to be int
......................................................................

network: caps vlan vlanid property has to be int

Engine expects caps vlan vlanid property to be integer.

Assert this condition in networkTests and fix ovs hook.

Change-Id: I737ae75e066ee27d5ecba0aa86118b94fd1ea62d
Signed-off-by: Petr Horáček <phoracek at redhat.com>
Bug-Url: https://bugzilla.redhat.com/1234867
---
M tests/functional/networkTests.py
M vdsm_hooks/ovs/ovs_after_get_caps.py
2 files changed, 10 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/81/50981/1

diff --git a/tests/functional/networkTests.py b/tests/functional/networkTests.py
index 5ab22d1..6172243 100644
--- a/tests/functional/networkTests.py
+++ b/tests/functional/networkTests.py
@@ -213,6 +213,7 @@
                             hostQos=None, assert_in_running_conf=True):
         netinfo = self.vdsm_net.netinfo
         config = self.vdsm_net.config
+        network_config = config.networks[networkName]
         self.assertIn(networkName, netinfo.networks)
         if bridged is not None:
             self.assertEqual(bridged, netinfo.networks[networkName]['bridged'])
@@ -231,8 +232,14 @@
         if assert_in_running_conf and config is not None:
             self.assertIn(networkName, config.networks)
             if bridged is not None:
-                self.assertEqual(config.networks[networkName].get('bridged'),
-                                 bridged)
+                self.assertEqual(network_config.get('bridged'), bridged)
+        physical_iface = (network_config.get('bonding') or
+                          network_config.get('nic'))
+        vlan_name = ('%s.%s' % (physical_iface, network_config['vlan'])
+                     if 'vlan' in network_config else None)
+        if 'vlan' in network_config:
+            self.assertTrue(isinstance(netinfo.vlans[vlan_name]['vlanid'],
+                                       int))
 
     def assertNetworkDoesntExist(self, networkName):
         netinfo = self.vdsm_net.netinfo
diff --git a/vdsm_hooks/ovs/ovs_after_get_caps.py b/vdsm_hooks/ovs/ovs_after_get_caps.py
index ea674b7..7b6f397 100755
--- a/vdsm_hooks/ovs/ovs_after_get_caps.py
+++ b/vdsm_hooks/ovs/ovs_after_get_caps.py
@@ -118,7 +118,7 @@
             iface = attrs.get('bonding') or attrs.get('nic')
             net_info['iface'] = iface
             net_info['bridged'] = True
-            net_info['vlanid'] = vlan
+            net_info['vlanid'] = int(vlan)
             ovs_vlans_caps['%s.%s' % (iface, vlan)] = net_info
     return ovs_vlans_caps
 


-- 
To view, visit https://gerrit.ovirt.org/50981
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I737ae75e066ee27d5ecba0aa86118b94fd1ea62d
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.6
Gerrit-Owner: Petr Horáček <phoracek at redhat.com>


More information about the vdsm-patches mailing list