← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1529439] [NEW] unify validate_agent_router_combination exceptions for dvr agent_mode

 

Public bug reported:

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."

** Affects: neutron
     Importance: Undecided
     Assignee: ZongKai LI (lzklibj)
         Status: New

** Changed in: neutron
     Assignee: (unassigned) => ZongKai LI (lzklibj)

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

Title:
  unify validate_agent_router_combination exceptions for dvr agent_mode

Status in neutron:
  New

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."

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


Follow ups