From bf862933628e48d70cfee121e24833660bb80eea Mon Sep 17 00:00:00 2001 From: Slawek Kaplonski Date: Tue, 21 Jan 2025 11:50:04 +0100 Subject: [PATCH] Add "vlan_qinq" attribute to the "network" resource Depends-On: https://review.opendev.org/c/openstack/python-openstackclient/+/940111 Related-Bug: #1915151 Change-Id: I58e9a8bde3dc9425c8ea698a6f4ec07ce21f1e5a --- openstack/network/v2/network.py | 2 ++ openstack/tests/unit/cloud/test_network.py | 1 + openstack/tests/unit/network/v2/test_network.py | 2 ++ .../add-vlan_qinq-to-the-network-72d69e4f8856d48f.yaml | 6 ++++++ 4 files changed, 11 insertions(+) create mode 100644 releasenotes/notes/add-vlan_qinq-to-the-network-72d69e4f8856d48f.yaml diff --git a/openstack/network/v2/network.py b/openstack/network/v2/network.py index 12e0e4b21..1abc37031 100644 --- a/openstack/network/v2/network.py +++ b/openstack/network/v2/network.py @@ -115,6 +115,8 @@ class Network(_base.NetworkResource, _base.TagMixinNetwork): updated_at = resource.Body('updated_at') #: Indicates the VLAN transparency mode of the network is_vlan_transparent = resource.Body('vlan_transparent', type=bool) + #: Indicates the VLAN QinQ mode of the network + is_vlan_qinq = resource.Body('vlan_qinq', type=bool) class DHCPAgentHostingNetwork(Network): diff --git a/openstack/tests/unit/cloud/test_network.py b/openstack/tests/unit/cloud/test_network.py index fe460ab14..53b3c5740 100644 --- a/openstack/tests/unit/cloud/test_network.py +++ b/openstack/tests/unit/cloud/test_network.py @@ -162,6 +162,7 @@ class TestNetworks(base.TestCase): 'mtu': 0, 'dns_domain': 'sample.openstack.org.', 'vlan_transparent': None, + 'vlan_qinq': None, 'segments': None, } diff --git a/openstack/tests/unit/network/v2/test_network.py b/openstack/tests/unit/network/v2/test_network.py index ad909d172..f902dfec9 100644 --- a/openstack/tests/unit/network/v2/test_network.py +++ b/openstack/tests/unit/network/v2/test_network.py @@ -42,6 +42,7 @@ EXAMPLE = { 'subnets': ['18', '19'], 'updated_at': '2016-07-09T12:14:57.233772', 'vlan_transparent': False, + 'vlan_qinq': False, } @@ -97,6 +98,7 @@ class TestNetwork(base.TestCase): self.assertEqual(EXAMPLE['subnets'], sot.subnet_ids) self.assertEqual(EXAMPLE['updated_at'], sot.updated_at) self.assertEqual(EXAMPLE['vlan_transparent'], sot.is_vlan_transparent) + self.assertEqual(EXAMPLE['vlan_qinq'], sot.is_vlan_qinq) self.assertDictEqual( { diff --git a/releasenotes/notes/add-vlan_qinq-to-the-network-72d69e4f8856d48f.yaml b/releasenotes/notes/add-vlan_qinq-to-the-network-72d69e4f8856d48f.yaml new file mode 100644 index 000000000..95e2e2f70 --- /dev/null +++ b/releasenotes/notes/add-vlan_qinq-to-the-network-72d69e4f8856d48f.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Add ``vlan_qinq`` attribute to the ``network`` resource. Users can use this + attribute to create network which will allow to configure VLANs + transparently in the guest VM and will use ethertype ``0x8a88 (802.1ad)``.