Change "propagate_uplink_status" default value to True
When "uplink-status-propagation" extension is enabled, new ports created will default the value of "propagate_uplink_status" to True. Closes-Bug: #1888487 Change-Id: If1e533a61aeebbb4761d669c516fe86a4381765c
This commit is contained in:
parent
b78a953d7f
commit
d4ae3f75a5
neutron
db
migration/alembic_migrations/versions
models
objects/port/extensions
tests/unit/objects
releasenotes/notes
@ -1 +1 @@
|
||||
1ea5dab0897a
|
||||
49d8622c5221
|
||||
|
36
neutron/db/migration/alembic_migrations/versions/victoria/expand/49d8622c5221_propagate_uplink_status_defaults_to_true.py
Normal file
36
neutron/db/migration/alembic_migrations/versions/victoria/expand/49d8622c5221_propagate_uplink_status_defaults_to_true.py
Normal file
@ -0,0 +1,36 @@
|
||||
# Copyright 2020 OpenStack Foundation
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License"); you may
|
||||
# not use this file except in compliance with the License. You may obtain
|
||||
# a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||
# License for the specific language governing permissions and limitations
|
||||
# under the License.
|
||||
#
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
"""propagate_uplink_status_defaults_to_true
|
||||
|
||||
Revision ID: 49d8622c5221
|
||||
Revises: 1ea5dab0897a
|
||||
Create Date: 2020-07-31 15:27:29.425953
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '49d8622c5221'
|
||||
down_revision = '1ea5dab0897a'
|
||||
|
||||
|
||||
def upgrade():
|
||||
op.alter_column('portuplinkstatuspropagation', 'propagate_uplink_status',
|
||||
existing_type=sa.Boolean(), existing_nullable=False,
|
||||
server_default=sa.sql.true())
|
@ -24,7 +24,7 @@ class PortUplinkStatusPropagation(model_base.BASEV2):
|
||||
sa.ForeignKey('ports.id', ondelete="CASCADE"),
|
||||
primary_key=True, index=True)
|
||||
propagate_uplink_status = sa.Column(sa.Boolean(), nullable=False,
|
||||
server_default=sa.sql.false())
|
||||
server_default=sa.sql.true())
|
||||
port = orm.relationship(
|
||||
models_v2.Port, load_on_pending=True,
|
||||
backref=orm.backref("propagate_uplink_status",
|
||||
|
@ -20,7 +20,8 @@ from neutron.objects import base
|
||||
@base.NeutronObjectRegistry.register
|
||||
class PortUplinkStatusPropagation(base.NeutronDbObject):
|
||||
# Version 1.0: Initial version
|
||||
VERSION = "1.0"
|
||||
# Version 1.1: Changed default value of "propagate_uplink_status" to True
|
||||
VERSION = "1.1"
|
||||
|
||||
db_model = db_models.PortUplinkStatusPropagation
|
||||
|
||||
@ -28,7 +29,7 @@ class PortUplinkStatusPropagation(base.NeutronDbObject):
|
||||
|
||||
fields = {
|
||||
'port_id': common_types.UUIDField(),
|
||||
'propagate_uplink_status': obj_fields.BooleanField(default=False),
|
||||
'propagate_uplink_status': obj_fields.BooleanField(default=True),
|
||||
}
|
||||
|
||||
foreign_keys = {'Port': {'port_id': 'id'}}
|
||||
|
@ -76,7 +76,7 @@ object_data = {
|
||||
'PortDNS': '1.1-c5ca2dc172bdd5fafee3fc986d1d7023',
|
||||
'PortForwarding': '1.2-f772f03b82a616603c7f3d4497bf577f',
|
||||
'PortSecurity': '1.0-b30802391a87945ee9c07582b4ff95e3',
|
||||
'PortUplinkStatusPropagation': '1.0-3cfb3f7da716ca9687e4f04ca72b081d',
|
||||
'PortUplinkStatusPropagation': '1.1-f0a4ca451a941910376c33616dea5de2',
|
||||
'ProviderResourceAssociation': '1.0-05ab2d5a3017e5ce9dd381328f285f34',
|
||||
'ProvisioningBlock': '1.0-c19d6d05bfa8143533471c1296066125',
|
||||
'QosBandwidthLimitRule': '1.3-51b662b12a8d1dfa89288d826c6d26d3',
|
||||
|
@ -0,0 +1,5 @@
|
||||
---
|
||||
other:
|
||||
- |
|
||||
When ``uplink-status-propagation`` extension is enabled, new ports created
|
||||
will default the value of ``propagate_uplink_status`` to True.
|
Loading…
x
Reference in New Issue
Block a user