unify validate_agent_router_combination exceptions for dvr agent_mode

Bug #1529439 reported by ZongKai LI on 2015-12-27
This bug affects 1 person
Affects Status Importance Assigned to Milestone
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'],

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) on 2015-12-27
Changed in neutron:
assignee: nobody → ZongKai LI (lzklibj)

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)

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

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

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

Other bug subscribers