Error message from placement when creating resource provider uses ambiguous identifier

Bug #1735405 reported by Chris Dent
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Undecided
Chris Dent

Bug Description

Nova master, late november

When a resource provider fails to create after a POST /resource_providers for some reason, the error message identifies the provider by uuid. However, the uuid may not have been supplied by the client, it may be generated server side. So the name should be included at:

https://github.com/openstack/nova/blob/daa1cd6d7660a0fb41b501c44db307c3e43f7600/nova/api/openstack/placement/handlers/resource_provider.py#L145

However, because of JSONSchema, it's unlikely (impossible) that ObjectActionError will ever be raised so another option may be to just get rid of the handling.

To resolve this:

* figure out if the exception can happen
* if not, remove the handling
* if so, change the message to include the 'name' in the output

Tags: placement
Matt Riedemann (mriedem)
Changed in nova:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

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

Changed in nova:
assignee: nobody → Chris Dent (cdent)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/526710
Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=885ad10edc67eb1f64590f1aef120865926b133d
Submitter: Zuul
Branch: master

commit 885ad10edc67eb1f64590f1aef120865926b133d
Author: Chris Dent <email address hidden>
Date: Fri Dec 8 15:28:15 2017 +0000

    [placement] add name to resource provider create error

    When a resource provider is created an ObjectActionError can
    happen. The API handler for POST /resource_provider catches
    this and sends out an error response. Prior to this change the
    response only identified the resource provider by uuid. Since
    it is possible to create a resource provider by only providing
    a name, this error response may not be super useful.

    This change adds the name of the proposed resource provider to
    the message, to make sure things are clear.

    However, it's worth noting that at the current time most
    situations which would cause an ObjectActionError are not
    possible from the API code path: they are caught by the
    JSONSchema validation. The one clear path that is not caught,
    and thus is the place where a validation of the response has
    been done in a gabbit, is when a resource provider tries to
    set its parent uuid to its own uuid. In order for the caller
    to do this, the caller has to know its own uuid, so the
    ambiguity problem is moot.

    As we might make additional changes in the future, adding
    the name seems the most flexible thing to do, so here it
    is.

    Change-Id: I7fee5344fc7cb2e4ba3f46e192ba0122edeb0605
    Closes-Bug: #1735405

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

This issue was fixed in the openstack/nova 17.0.0.0b3 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.