Unable to fetch the details of a keypair with name "new".

Bug #1615475 reported by Praveen Kapoor
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Unassigned

Bug Description

Key pair is created with name as the main id. We have found that if we try to create a key pair with the name "new", the key-pair is created successfully ( which can be confirmed with
a. Try to create key-pair with same name "new", os-keypair API throws {
    "conflictingRequest": {
        "message": "Key pair 'new' already exists.",
        "code": 409
    }
}

b. Make a GET call for all key-pairs the returned list has the information for "new" key-pair as well.),

but fetching the details of the key-pair with name "new" runs into error. The issue seems to be with the name "new" only as there does not seem to be issues with other names.

Changed in nova:
assignee: nobody → Praveen Kapoor (pravkapo)
Revision history for this message
Praveen Kapoor (pravkapo) wrote :
Revision history for this message
Maciej Szankin (mszankin) wrote :

Successfully reproduced, good catch.

Changed in nova:
status: New → In Progress
Revision history for this message
John Garbutt (johngarbutt) wrote :

Its good to get the REST API request underneath horizon here, just so its clear whats going on here.

I assumed keypairs were always fetched by id in horizon, I guess thats not the case?

Revision history for this message
Alex Xu (xuhj) wrote :

This due to we create routes by mapper.resource https://github.com/openstack/nova/blob/master/nova/api/openstack/__init__.py#L312

It follow the the Atom publishing protocol. It will create some routes like this:
GET /messages/new => messages.new() => url("new_message")
GET /messages/1/edit => messages.edit(id) => url("edit_message", id=1)

But we never implement those routes for any API.

Revision history for this message
Praveen Kapoor (pravkapo) wrote :

yes..

We are not fetching it using id.

GET /v2.1/<project_id>/os-keypairs/new =>
it returns itemNotFound.

{
 "itemNotFound": {
  "message": "The resource could not be found.",
  "code": 404
 }
}

however, GET of key-pair with any other name works fine.
Example-> GET /v2.1/<project_id>/os-keypairs/abc

Alex Xu (xuhj)
Changed in nova:
importance: Undecided → High
Revision history for this message
Alex Xu (xuhj) wrote :

We should get rid of those extra routes like 'GET /messages/new => messages.new() => url("new_message")'.

We can use a set of map.connect instead of map.resource

Sean Dague (sdague)
Changed in nova:
importance: High → Medium
status: In Progress → Confirmed
assignee: Praveen Kapoor (pravkapo) → nobody
manoj6030 (manoj2002)
Changed in nova:
assignee: nobody → manoj6030 (manoj2002)
Sean Dague (sdague)
Changed in nova:
assignee: manoj6030 (manoj2002) → nobody
Revision history for this message
Jianle He (hejianle1989) wrote :

It now worked well in pike

Changed in nova:
status: Confirmed → Fix Released
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.