L3 flavors handling flavor request incorrectly

Bug #1621430 reported by Kevin Benton
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
High
Kevin Benton

Bug Description

When creating a router only specifying a flavor ID, the L3 plugin is incorrectly assuming both a flavor ID and a distributed attribute were set because the DVR code populates the API body with the distributed flag. This results in a validation error like this:

Captured traceback:
~~~~~~~~~~~~~~~~~~~
    Traceback (most recent call last):
      File "/opt/stack/neutron/neutron/tests/tempest/api/admin/test_routers_flavors.py", line 65, in test_create_router_with_flavor
        router = self.client.create_router('name', flavor_id=flavor['id'])
      File "/opt/stack/neutron/neutron/tests/tempest/services/network/json/network_client.py", line 327, in create_router
        resp, body = self.post(uri, body)
      File "tempest/lib/common/rest_client.py", line 273, in post
        return self.request('POST', url, extra_headers, headers, body, chunked)
      File "tempest/lib/common/rest_client.py", line 667, in request
        resp, resp_body)
      File "tempest/lib/common/rest_client.py", line 831, in _error_checker
        message=message)
    tempest.lib.exceptions.ServerFault: Got server fault
    Details: Provider single_node does not support distributed=True

Changed in neutron:
importance: Undecided → High
assignee: nobody → Kevin Benton (kevinbenton)
milestone: none → newton-rc1
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/367332

Changed in neutron:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

Changed in neutron:
assignee: Kevin Benton (kevinbenton) → Brian Haley (brian-haley)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to neutron (master)

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

commit 841ce4837719cc210ba060f5f2eaa7568d7c3c46
Author: Kevin Benton <email address hidden>
Date: Wed Sep 7 23:21:04 2016 -0700

    Use correct exception in L3 driver controller

    The driver controller was using Invalid instead of InvalidInput
    for validation errors. This was being converted to a 500 instead
    of a BadRequest. This patch corrects it to use InvalidInput.

    Change-Id: I8f4913fe8f98580a925d3f5b80ad0353e4c9636f
    Partial-Bug: #1621430

Changed in neutron:
assignee: Brian Haley (brian-haley) → Kevin Benton (kevinbenton)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

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

commit b4b12f7ace84bbd62b3365ef05e712d178a1de18
Author: Kevin Benton <email address hidden>
Date: Wed Sep 7 22:49:43 2016 -0700

    Defer setting 'ha'/'distributed' flags in L3 code

    Both DVR and the HA code were setting the 'ha' and 'distributed'
    flags in the API body before it was being sent into the core L3
    code. This meant that it could not distinguish between
    user-requested flags and config-defaults, which is important for
    flavor validation.

    This patch just adjusts it so they aren't set until after the core
    create method is called.

    Long term these will be refactored to live in their corresponding
    driver anyway and will not need to be responsible for setting these
    flags to get them stored in the DB.

    Closes-Bug: #1621430
    Change-Id: I9945920d5540653cf5b86e8f1a2ba7b073595921

Changed in neutron:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/neutron 9.0.0.0rc1

This issue was fixed in the openstack/neutron 9.0.0.0rc1 release candidate.

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.