unify validate_agent_router_combination exceptions for dvr agent_mode

Bug #1529439 reported by ZongKai LI
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Wishlist
ZongKai LI

Bug Description

in method validate_agent_router_combination (https://github.com/openstack/neutron/blob/master/neutron/db/l3_agentschedulers_db.py#L157) , it will validate if the router can be correctly assigned to the agent.

And it will raise two different exceptions for dvr agent_mode agent, https://github.com/openstack/neutron/blob/master/neutron/db/l3_agentschedulers_db.py#L176-L187 :

        is_agent_router_types_incompatible = (
            agent_mode == constants.L3_AGENT_MODE_DVR and not is_distributed
            or agent_mode == constants.L3_AGENT_MODE_LEGACY and is_distributed
        )
        if is_agent_router_types_incompatible:
            raise l3agentscheduler.RouterL3AgentMismatch(
                router_type=router_type, router_id=router['id'],
                agent_mode=agent_mode, agent_id=agent['id'])
        if agent_mode == constants.L3_AGENT_MODE_DVR and is_distributed:
            raise l3agentscheduler.DVRL3CannotAssignToDvrAgent(
                router_type=router_type, router_id=router['id'],
                agent_id=agent['id'])

this should be unified and simplified for a single reason that "DVR router on dvr agent_mode agent should be only scheduled, not manually assigned."

ZongKai LI (zongkai)
Changed in neutron:
assignee: nobody → ZongKai LI (lzklibj)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to neutron (master)

Fix proposed to branch: master
Review: https://review.openstack.org/261793

Changed in neutron:
status: New → In Progress
Changed in neutron:
importance: Undecided → Low
importance: Low → Wishlist
tags: added: l3-dvr-backlog
Changed in neutron:
assignee: ZongKai LI (lzklibj) → Armando Migliaccio (armando-migliaccio)
Changed in neutron:
assignee: Armando Migliaccio (armando-migliaccio) → ZongKai LI (lzklibj)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

Reviewed: https://review.openstack.org/261793
Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=a2cfd9fcd67f392d9ad70868fa358afc7aa1b4c3
Submitter: Jenkins
Branch: master

commit a2cfd9fcd67f392d9ad70868fa358afc7aa1b4c3
Author: lzklibj <email address hidden>
Date: Sun Dec 27 14:08:36 2015 +0800

    Unify exceptions for assign router to dvr agent

    validate_agent_router_combination use two different exceptions
    for assigning a router to an agent in 'dvr' mode:
      RouterL3AgentMismatch: assign dvr router to legacy agent.
      DVRL3CannotAssignToDvrAgent: assign dvr router to (another) dvr agent.

    This should be unified to one single exception, for routers on agent in
    'dvr' mode should be only scheduled, not allowed to be manually assigned.

    Change-Id: I3673c4c6852105f86b3aac390d0aabc75944de9d
    Closes-Bug: #1529439

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/neutron 8.0.0.0b2

This issue was fixed in the openstack/neutron 8.0.0.0b2 development milestone.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.