From d027626d7faf92d44afc9b624bd4ccea35bec96a Mon Sep 17 00:00:00 2001 From: Hongbin Lu Date: Fri, 27 Jul 2018 17:02:56 -0400 Subject: [PATCH] Add propagate_uplink_status to port Neutron patch: https://review.openstack.org/#/c/571899/ Change-Id: Ie1c8c5229a86a1c5fa9afe84ff201aafedf63d6f Related-Bug: #1722720 --- openstack/network/v2/port.py | 3 +++ openstack/tests/unit/network/v2/test_port.py | 3 +++ ...agate_uplink_status-to-port-0152d476c65979e3.yaml | 12 ++++++++++++ 3 files changed, 18 insertions(+) create mode 100644 releasenotes/notes/add-propagate_uplink_status-to-port-0152d476c65979e3.yaml diff --git a/openstack/network/v2/port.py b/openstack/network/v2/port.py index e3290aef2..fba887d33 100644 --- a/openstack/network/v2/port.py +++ b/openstack/network/v2/port.py @@ -103,6 +103,9 @@ class Port(resource.Resource, tag.TagMixin): #: 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') + #: Whether to propagate uplink status of the port. *Type: bool* + propagate_uplink_status = resource.Body('propagate_uplink_status', + type=bool) #: The ID of the QoS policy attached to the port. qos_policy_id = resource.Body('qos_policy_id') #: Revision number of the port. *Type: int* diff --git a/openstack/tests/unit/network/v2/test_port.py b/openstack/tests/unit/network/v2/test_port.py index f2c798ddf..c9c8686a4 100644 --- a/openstack/tests/unit/network/v2/test_port.py +++ b/openstack/tests/unit/network/v2/test_port.py @@ -39,6 +39,7 @@ EXAMPLE = { 'network_id': '18', 'port_security_enabled': True, 'qos_policy_id': '21', + 'propagate_uplink_status': False, 'revision_number': 22, 'security_groups': ['23'], 'status': '25', @@ -121,6 +122,8 @@ class TestPort(base.TestCase): self.assertEqual(EXAMPLE['network_id'], sot.network_id) self.assertTrue(sot.is_port_security_enabled) self.assertEqual(EXAMPLE['qos_policy_id'], sot.qos_policy_id) + self.assertEqual(EXAMPLE['propagate_uplink_status'], + sot.propagate_uplink_status) self.assertEqual(EXAMPLE['revision_number'], sot.revision_number) self.assertEqual(EXAMPLE['security_groups'], sot.security_group_ids) self.assertEqual(EXAMPLE['status'], sot.status) diff --git a/releasenotes/notes/add-propagate_uplink_status-to-port-0152d476c65979e3.yaml b/releasenotes/notes/add-propagate_uplink_status-to-port-0152d476c65979e3.yaml new file mode 100644 index 000000000..28bf68160 --- /dev/null +++ b/releasenotes/notes/add-propagate_uplink_status-to-port-0152d476c65979e3.yaml @@ -0,0 +1,12 @@ +--- +features: + - | + Add ``propagate_uplink_status`` attribute to ``port`` resource. + Users can set this attribute to ``True`` or ``False``. + If it is set to ``True``, uplink status propagation is enabled. + Otherwise, it is disabled. + Neutron server needs to have the API extension + ``uplink-status-propagation`` in order to support this feature. + This feature can be used in SRIOV scenario, in which users + enable uplink status propagation of the SRIOV port + so that the link status of the VF will follow the PF.