← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1588281] [NEW] db_base_plugin_v2: id used instead of subnet_id

 

Public bug reported:

In db_base_plugin_v2 _subnet_check_ip_allocations_internal_router_ports(self, context, subnet_id)
code is referring to not declared variable 'id'. It was working before because the 'id' was defined in place where _subnet_check_ip_allocations_internal_router_ports() was invoked.

    def _subnet_check_ip_allocations_internal_router_ports(self, context,
                                                           subnet_id):
        # Do not delete the subnet if IP allocations for internal
        # router ports still exist
        allocs = context.session.query(models_v2.IPAllocation).filter_by(
                subnet_id=subnet_id).join(models_v2.Port).filter(
                        models_v2.Port.device_owner.in_(
                            constants.ROUTER_INTERFACE_OWNERS)
                ).first()
        if allocs:
            LOG.debug("Subnet %s still has internal router ports, "
                      "cannot delete", subnet_id)
            raise exc.SubnetInUse(subnet_id=id)

the last line should be subnet_id=subnet_id.

** Affects: neutron
     Importance: Undecided
         Status: New

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

Title:
  db_base_plugin_v2: id used instead of subnet_id

Status in neutron:
  New

Bug description:
  In db_base_plugin_v2 _subnet_check_ip_allocations_internal_router_ports(self, context, subnet_id)
  code is referring to not declared variable 'id'. It was working before because the 'id' was defined in place where _subnet_check_ip_allocations_internal_router_ports() was invoked.

      def _subnet_check_ip_allocations_internal_router_ports(self, context,
                                                             subnet_id):
          # Do not delete the subnet if IP allocations for internal
          # router ports still exist
          allocs = context.session.query(models_v2.IPAllocation).filter_by(
                  subnet_id=subnet_id).join(models_v2.Port).filter(
                          models_v2.Port.device_owner.in_(
                              constants.ROUTER_INTERFACE_OWNERS)
                  ).first()
          if allocs:
              LOG.debug("Subnet %s still has internal router ports, "
                        "cannot delete", subnet_id)
              raise exc.SubnetInUse(subnet_id=id)

  the last line should be subnet_id=subnet_id.

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


Follow ups