← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1735405] Re: Error message from placement when creating resource provider uses ambiguous identifier

 

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 <cdent@xxxxxxxxxxxxx>
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

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/1735405

Title:
  Error message from placement when creating resource provider uses
  ambiguous identifier

Status in OpenStack Compute (nova):
  Fix Released

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

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


References