diff --git a/neutron/db/uplink_status_propagation_db.py b/neutron/db/uplink_status_propagation_db.py index ed7fe0edb71..528fb9b67da 100644 --- a/neutron/db/uplink_status_propagation_db.py +++ b/neutron/db/uplink_status_propagation_db.py @@ -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) diff --git a/neutron/tests/unit/plugins/ml2/extensions/test_uplink_status_propagation.py b/neutron/tests/unit/plugins/ml2/extensions/test_uplink_status_propagation.py index b9fd228ded1..c7964cf62fa 100644 --- a/neutron/tests/unit/plugins/ml2/extensions/test_uplink_status_propagation.py +++ b/neutron/tests/unit/plugins/ml2/extensions/test_uplink_status_propagation.py @@ -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: diff --git a/releasenotes/notes/propagate_uplink_status_enabled_default-df3daba66e79d056.yaml b/releasenotes/notes/propagate_uplink_status_enabled_default-df3daba66e79d056.yaml new file mode 100644 index 00000000000..264b0995f66 --- /dev/null +++ b/releasenotes/notes/propagate_uplink_status_enabled_default-df3daba66e79d056.yaml @@ -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.