Add "trusted" attribute to "port" resource

Related-bug: #2060916
Change-Id: Id065db33d7a71f0b4aac8ee95d4d3947736a7bda
This commit is contained in:
Slawek Kaplonski 2024-09-02 11:28:05 +02:00
parent b65b7d4d3e
commit 7994f88a35
3 changed files with 11 additions and 0 deletions
openstack
network/v2
tests/unit/network/v2
releasenotes/notes

@ -161,5 +161,8 @@ class Port(_base.NetworkResource, tag.TagMixin):
#: sub_ports is a list of dicts with keys:
#: port_id, segmentation_type, segmentation_id, mac_address*
trunk_details = resource.Body('trunk_details', type=dict)
#: Status of the trusted VIF setting, this value is added to the
#: binding:profile field and passed to services which needs, it, like Nova
trusted = resource.Body('trusted', type=bool)
#: Timestamp when the port was last updated.
updated_at = resource.Body('updated_at')

@ -67,6 +67,7 @@ EXAMPLE = {
}
],
},
'trusted': True,
'updated_at': '2016-07-09T12:14:57.233772',
}
@ -165,4 +166,5 @@ class TestPort(base.TestCase):
self.assertEqual(EXAMPLE['status'], sot.status)
self.assertEqual(EXAMPLE['project_id'], sot.project_id)
self.assertEqual(EXAMPLE['trunk_details'], sot.trunk_details)
self.assertEqual(EXAMPLE['trusted'], sot.trusted)
self.assertEqual(EXAMPLE['updated_at'], sot.updated_at)

@ -0,0 +1,6 @@
---
features:
- |
Add ``trusted`` attribute to ``port`` resourse. Users can use this
attribute to set port to be trusted what will be then populated into
the ``binding:profile`` dictionary.