From: Ann Kamyshnikova Date: Fri, 21 Mar 2014 08:33:30 +0000 (+0400) Subject: Fix 'server_default' parameter usage in models X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=40223f44d6e48e09d65c8a0b71ed587c434ed97c;p=openstack-build%2Fneutron-build.git Fix 'server_default' parameter usage in models In ml2 models parameter 'default' is used for vnic_type, profile and vif_details, but in migrations 27cc183af192_ml2_vnic_type, 157a5d299379_ml2_binding_profile and 50d5ba354c23_ml2_binding_vif_details is used 'server_default' parameter. Usage 'default' and 'server_default' should be equal in models and migration. So models in models is added 'server_default' parameter. Partial-bug: #1295539 Change-Id: If6a17f381d2550daf64916ad3c1b120f41406d56 --- diff --git a/neutron/plugins/ml2/models.py b/neutron/plugins/ml2/models.py index 0ab805f1c..9ec9d627b 100644 --- a/neutron/plugins/ml2/models.py +++ b/neutron/plugins/ml2/models.py @@ -55,13 +55,16 @@ class PortBinding(model_base.BASEV2): port_id = sa.Column(sa.String(36), sa.ForeignKey('ports.id', ondelete="CASCADE"), primary_key=True) - host = sa.Column(sa.String(255), nullable=False, default='') + host = sa.Column(sa.String(255), nullable=False, default='', + server_default='') vnic_type = sa.Column(sa.String(64), nullable=False, - default=portbindings.VNIC_NORMAL) + default=portbindings.VNIC_NORMAL, + server_default=portbindings.VNIC_NORMAL) profile = sa.Column(sa.String(BINDING_PROFILE_LEN), nullable=False, - default='') + default='', server_default='') vif_type = sa.Column(sa.String(64), nullable=False) - vif_details = sa.Column(sa.String(4095), nullable=False, default='') + vif_details = sa.Column(sa.String(4095), nullable=False, default='', + server_default='') driver = sa.Column(sa.String(64)) segment = sa.Column(sa.String(36), sa.ForeignKey('ml2_network_segments.id',