From e91941a0b841e5c4b58695d66489bbd0e9b73462 Mon Sep 17 00:00:00 2001 From: Moshe Levi Date: Tue, 23 Feb 2016 13:40:21 +0200 Subject: [PATCH] Remove vlan from hostdev and direct vif This patch remove the vlan attribute from hostdev and direct vif. The vlan should be taken from the network object. When the network vlan is null (for example in flat network) it should be zero in the libvirt xml Change-Id: Icf6dd39f515f5c2f8db8c1d414776eebd8e85617 --- os_vif/objects/vif.py | 6 ------ os_vif/tests/test_vif.py | 7 +++---- 2 files changed, 3 insertions(+), 10 deletions(-) diff --git a/os_vif/objects/vif.py b/os_vif/objects/vif.py index 3b7d6ff4..70397226 100644 --- a/os_vif/objects/vif.py +++ b/os_vif/objects/vif.py @@ -103,9 +103,6 @@ class VIFDirect(VIFBase): # Port connection mode 'mode': osv_fields.VIFDirectModeField(), - # The VLAN number to use - 'vlan': fields.IntegerField(), - # The VLAN device name to use 'vlan_name': fields.StringField(), } @@ -142,9 +139,6 @@ class VIFHostDevice(VIFBase): # The PCI address of the host device 'dev_address': osv_fields.PCIAddressField(), - - # The VLAN number to use - 'vlan': fields.IntegerField(), } diff --git a/os_vif/tests/test_vif.py b/os_vif/tests/test_vif.py index 3f177aff..0ca7acd2 100644 --- a/os_vif/tests/test_vif.py +++ b/os_vif/tests/test_vif.py @@ -85,14 +85,13 @@ class TestVIFS(base.TestCase): self._test_vif( objects.vif.VIFHostDevice, dev_type=objects.fields.VIFVIFHostDeviceDevType.ETHERNET, - dev_address="0002:24:12.3", vlan=8) + dev_address="0002:24:12.3") def test_vif_host_dev_vepa_qbh(self): prof = objects.vif.VIFPortProfile8021Qbh( profile_id="fishfood") self._test_vif(objects.vif.VIFHostDevice, dev_address="0002:24:12.3", - vlan=8, port_profile=prof) object_data = { @@ -106,9 +105,9 @@ object_data = { 'SubnetList': '1.0-15ecf022a68ddbb8c2a6739cfc9f8f5e', 'VIFBase': '1.0-4a5a8881dc999752cb050dd443458b6a', 'VIFBridge': '1.0-e78d355f3505361fafbf0797ffad484a', - 'VIFDirect': '1.0-d07d1f26bb58b6677c5304b652cc64f1', + 'VIFDirect': '1.0-05c939280f4025fd1f7efb921a835c57', 'VIFGeneric': '1.0-c72e637ed620f0135ea50a9409a3f389', - 'VIFHostDevice': '1.0-7289a0eb0a69aeb5d821a0d006e3e444', + 'VIFHostDevice': '1.0-b3516f5af46ecb9432650e4938ac2643', 'VIFOpenVSwitch': '1.0-e78d355f3505361fafbf0797ffad484a', 'VIFPortProfile8021Qbg': '1.0-167f305f6e982b9368cc38763815d429', 'VIFPortProfile8021Qbh': '1.0-4b945f07d2666ab00a48d1dc225669b1',