Add propagate_uplink_status to port

Neutron patch: https://review.openstack.org/#/c/571899/

Change-Id: Ie1c8c5229a86a1c5fa9afe84ff201aafedf63d6f
Related-Bug: #1722720
This commit is contained in:
Hongbin Lu 2018-07-27 17:02:56 -04:00
parent 660d193623
commit d027626d7f
3 changed files with 18 additions and 0 deletions

View File

@ -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*

View File

@ -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)

View File

@ -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.