add keypair fail

Bug #1493207 reported by Chung Chih, Hung
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
New
Undecided
Chung Chih, Hung

Bug Description

Add keypair fail in horizon.
But it still work at nova cli.

Following is keypair-add api request in log
2015-09-08 05:09:49.213635 REQ: curl -g -i 'http://10.20.0.105:8774/v2.1/c6d51ff62ef147aaa5ec7e7583de74c7/os-keypairs' -X POST -H "Accept: application/json" -H "Content-Type: application/json" -H "User-Agent: python-novaclient" -H "X-Auth-Project-Id: c6d51ff62ef147aaa5ec7e7583de74c7" -H "X-Auth-Token: {SHA1}bfc226cbca590d089f197b71fdcf88df5ea50175" -d '{"keypair": {"type": "ssh", "name": "d"}}'
2015-09-08 05:09:49.223710 RESP: [400] {'content-length': '190', 'x-compute-request-id': 'req-25eab1e0-20d7-4738-83ff-78061ce977bf', 'vary': 'X-OpenStack-Nova-API-Version', 'connection': 'keep-alive', 'x-openstack-nova-api-version': '2.1', 'date': 'Tue, 08 Sep 2015 05:09:49 GMT', 'content-type': 'application/json; charset=UTF-8'}
2015-09-08 05:09:49.223823 RESP BODY: null
2015-09-08 05:09:49.223882
2015-09-08 05:09:49.224676 Recoverable error: Invalid input for field/attribute keypair. Value: {u'type': u'ssh', u'name': u'd'}. Additional properties are not allowed (u'type' was unexpected) (HTTP 400) (Request-ID: req-25eab1e0-20d7-4738-83ff-78061ce977bf)

Body's schema is supported by api version above 2.2.
However horizon mark this request as 2.1 version.
Type is not allowed properties at 2.1.
Therefore this exception will been raised.

Besides nova cli is send 2.11 version, so it will work.

Changed in horizon:
assignee: nobody → Chung Chih, Hung (lyanchih)
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.