[SR-IOV] Default "propagate_uplink_status" flag to True
Extension "uplink-status-propagation" does not allow to modify existing ports. This extension only enables the creation of new ports with this new flag. Similar to [1], this patch changes the default behaviour of the exiting ports: if no "propagate_uplink_status" flag is present, "True" is returned now. The aim of this change is to enable this feature for all existing ports, that is usually the aim of an administrator when enables this extension. [1]https://bugs.launchpad.net/neutron/+bug/1888487 Closes-Bug: #1967881 Related-Bug: #1888487 Change-Id: Ica5b76e0a9a5ae12f764c66be259d7f3cd5b248b
This commit is contained in:
parent
3615cd85a4
commit
3a81b051d4
@ -28,6 +28,10 @@ class UplinkStatusPropagationMixin(object):
|
||||
|
||||
@staticmethod
|
||||
def _extend_port_dict(port_res, port_db):
|
||||
# NOTE(ralonsoh): the default value is "True". Ports created before
|
||||
# enabling this extension won't have an associated
|
||||
# "PortUplinkStatusPropagation" register but we assume they have this
|
||||
# flag enabled.
|
||||
usp_db = port_db.get(usp.PROPAGATE_UPLINK_STATUS)
|
||||
port_res[usp.PROPAGATE_UPLINK_STATUS] = (
|
||||
usp_db.propagate_uplink_status if usp_db else False)
|
||||
usp_db.propagate_uplink_status if usp_db else True)
|
||||
|
@ -39,7 +39,7 @@ class UplinkStatusPropagationML2ExtDriverTestCase(
|
||||
|
||||
driver = usp.UplinkStatusPropagationExtensionDriver()
|
||||
driver.extend_port_dict(session, db_data, response_data)
|
||||
self.assertFalse(response_data['propagate_uplink_status'])
|
||||
self.assertTrue(response_data['propagate_uplink_status'])
|
||||
|
||||
def test_show_port_has_propagate_uplink_status(self):
|
||||
with self.port(propagate_uplink_status=True) as port:
|
||||
|
@ -0,0 +1,7 @@
|
||||
---
|
||||
features:
|
||||
- |
|
||||
If ``uplink-status-propagation`` extension is enabled, all existing ports
|
||||
before enabling it will have the flag "propagate_uplink_status" enabled by
|
||||
default. This is aligned with the aim of an administrator that enables
|
||||
this extension. Now only new ports can be created with this flag disabled.
|
Loading…
Reference in New Issue
Block a user