diff --git a/vmware_nsx/db/db.py b/vmware_nsx/db/db.py index 4267786d2c..ec8be03d7d 100644 --- a/vmware_nsx/db/db.py +++ b/vmware_nsx/db/db.py @@ -330,19 +330,6 @@ def delete_neutron_nsx_router_mapping(session, neutron_id): session, nsx_models.NeutronNsxRouterMapping, neutron_id) -def unset_default_network_gateways(session): - with session.begin(subtransactions=True): - session.query(nsx_models.NetworkGateway).update( - {nsx_models.NetworkGateway.default: False}) - - -def set_default_network_gateway(session, gw_id): - with session.begin(subtransactions=True): - gw = (session.query(nsx_models.NetworkGateway). - filter_by(id=gw_id).one()) - gw['default'] = True - - def set_multiprovider_network(session, network_id): with session.begin(subtransactions=True): multiprovider_network = nsx_models.MultiProviderNetworks( @@ -402,29 +389,6 @@ def delete_qos_policy_profile_mapping(session, qos_policy_id): filter_by(qos_policy_id=qos_policy_id).delete()) -# NSXv3 Port Mirror Sessions DB methods. -def add_port_mirror_session_mapping(session, tf_id, pm_session_id): - with session.begin(subtransactions=True): - mapping = nsx_models.NsxPortMirrorSessionMapping( - tap_flow_id=tf_id, - port_mirror_session_id=pm_session_id) - session.add(mapping) - return mapping - - -def get_port_mirror_session_mapping(session, tf_id): - try: - return (session.query(nsx_models.NsxPortMirrorSessionMapping). - filter_by(tap_flow_id=tf_id).one()) - except exc.NoResultFound: - raise nsx_exc.NsxPortMirrorSessionMappingNotFound(tf=tf_id) - - -def delete_port_mirror_session_mapping(session, tf_id): - return (session.query(nsx_models.NsxPortMirrorSessionMapping). - filter_by(tap_flow_id=tf_id).delete()) - - @db_api.CONTEXT_WRITER def save_sg_mappings(context, sg_id, nsgroup_id, section_id): context.session.add( diff --git a/vmware_nsx/db/nsx_models.py b/vmware_nsx/db/nsx_models.py index b655bc6bed..cdebec343a 100644 --- a/vmware_nsx/db/nsx_models.py +++ b/vmware_nsx/db/nsx_models.py @@ -217,6 +217,7 @@ class NetworkConnection(model_base.BASEV2, model_base.HasProject, class NetworkGatewayDeviceReference(model_base.BASEV2, models.TimestampMixin): + # This table is no longer in use id = sa.Column(sa.String(36), primary_key=True) network_gateway_id = sa.Column(sa.String(36), sa.ForeignKey('networkgateways.id', @@ -227,6 +228,7 @@ class NetworkGatewayDeviceReference(model_base.BASEV2, models.TimestampMixin): class NetworkGatewayDevice(model_base.BASEV2, model_base.HasId, model_base.HasProject, models.TimestampMixin): + # This table is no longer in use nsx_id = sa.Column(sa.String(36)) # Optional name for the gateway device name = sa.Column(sa.String(255)) @@ -242,6 +244,7 @@ class NetworkGatewayDevice(model_base.BASEV2, model_base.HasId, class NetworkGateway(model_base.BASEV2, model_base.HasId, model_base.HasProject, models.TimestampMixin): """Defines the data model for a network gateway.""" + # This table is no longer in use name = sa.Column(sa.String(255)) default = sa.Column(sa.Boolean()) devices = orm.relationship(NetworkGatewayDeviceReference, @@ -317,6 +320,7 @@ class QosPolicySwitchProfile(model_base.BASEV2, models.TimestampMixin): class NsxPortMirrorSessionMapping(model_base.BASEV2): """Define a mapping between Tap Flow and PortMirrorSession object.""" + # This table is no longer in use __tablename__ = 'nsx_port_mirror_session_mappings' tap_flow_id = sa.Column(sa.String(36), nullable=False,