← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1319581] [NEW] NSX: missing fk constraint between network gateway and devices

 

Public bug reported:

https://github.com/openstack/neutron/blob/master/neutron/plugins/vmware/dbexts/networkgw_db.py#L120

class NetworkGatewayDeviceReference(model_base.BASEV2):
    id = sa.Column(sa.String(36), primary_key=True)
    network_gateway_id = sa.Column(sa.String(36),
                                   sa.ForeignKey('networkgateways.id',
                                                 ondelete='CASCADE'),
                                   primary_key=True)
    interface_name = sa.Column(sa.String(64), primary_key=True)

The field 'id' refers to a gateway device. As there is no foreign key
constraint the database layer will allow for creating gateway for non-
existing devices - the error will then be detected in the backend
anyway, but it should be caught at the DB layer.

** Affects: neutron
     Importance: Medium
     Assignee: Salvatore Orlando (salvatore-orlando)
         Status: New


** Tags: vmware

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1319581

Title:
  NSX: missing fk constraint between network gateway and devices

Status in OpenStack Neutron (virtual network service):
  New

Bug description:
  https://github.com/openstack/neutron/blob/master/neutron/plugins/vmware/dbexts/networkgw_db.py#L120

  class NetworkGatewayDeviceReference(model_base.BASEV2):
      id = sa.Column(sa.String(36), primary_key=True)
      network_gateway_id = sa.Column(sa.String(36),
                                     sa.ForeignKey('networkgateways.id',
                                                   ondelete='CASCADE'),
                                     primary_key=True)
      interface_name = sa.Column(sa.String(64), primary_key=True)

  The field 'id' refers to a gateway device. As there is no foreign key
  constraint the database layer will allow for creating gateway for non-
  existing devices - the error will then be detected in the backend
  anyway, but it should be caught at the DB layer.

To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1319581/+subscriptions


Follow ups

References