From 1124c32dd25fd1744502e923244fbb9532bae106 Mon Sep 17 00:00:00 2001 From: Rodolfo Alonso Hernandez Date: Fri, 10 Jul 2020 08:56:06 +0000 Subject: [PATCH] Add "numa_affinity_policy" attribute to "port" Change-Id: I467ac83f04d0724897fb59b789ae9b666942e1ea Related-Bug: #1886798 --- openstack/network/v2/port.py | 2 ++ openstack/tests/unit/network/v2/test_port.py | 3 +++ .../add-port-numa-affinity-policy-b42a85dbe26560d2.yaml | 6 ++++++ 3 files changed, 11 insertions(+) create mode 100644 releasenotes/notes/add-port-numa-affinity-policy-b42a85dbe26560d2.yaml diff --git a/openstack/network/v2/port.py b/openstack/network/v2/port.py index 6efcad0fb..e517607bc 100644 --- a/openstack/network/v2/port.py +++ b/openstack/network/v2/port.py @@ -104,6 +104,8 @@ class Port(_base.NetworkResource, resource.TagMixin): name = resource.Body('name') #: The ID of the attached network. network_id = resource.Body('network_id') + #: The NUMA affinity policy defined for this port. + numa_affinity_policy = resource.Body('numa_affinity_policy') #: The ID of the project who owns the network. Only administrative #: users can specify a project ID other than their own. project_id = resource.Body('tenant_id') diff --git a/openstack/tests/unit/network/v2/test_port.py b/openstack/tests/unit/network/v2/test_port.py index a40b46294..3312d9af2 100644 --- a/openstack/tests/unit/network/v2/test_port.py +++ b/openstack/tests/unit/network/v2/test_port.py @@ -38,6 +38,7 @@ EXAMPLE = { 'mac_address': '16', 'name': '17', 'network_id': '18', + 'numa_affinity_policy': False, 'port_security_enabled': True, 'qos_network_policy_id': '32', 'qos_policy_id': '21', @@ -130,6 +131,8 @@ class TestPort(base.TestCase): self.assertEqual(EXAMPLE['mac_address'], sot.mac_address) self.assertEqual(EXAMPLE['name'], sot.name) self.assertEqual(EXAMPLE['network_id'], sot.network_id) + self.assertEqual(EXAMPLE['numa_affinity_policy'], + sot.numa_affinity_policy) self.assertTrue(sot.is_port_security_enabled) self.assertEqual(EXAMPLE['qos_network_policy_id'], sot.qos_network_policy_id) diff --git a/releasenotes/notes/add-port-numa-affinity-policy-b42a85dbe26560d2.yaml b/releasenotes/notes/add-port-numa-affinity-policy-b42a85dbe26560d2.yaml new file mode 100644 index 000000000..2696cb40e --- /dev/null +++ b/releasenotes/notes/add-port-numa-affinity-policy-b42a85dbe26560d2.yaml @@ -0,0 +1,6 @@ +--- +features: + - | + Add ``numa_affinity_policy`` attribute to ``port`` resource. Users + can set this attribute to ``required``, ``deferred`` or ``legacy``. + This parameter is nullable.