Comment 4 for bug 957706

Revision history for this message
Rajalakshmi Ganesan (rajalakshmi-ganesan) wrote : Re: Associating non-existant floating ip yields 500

The same scenario is now returning ERROR CODE 400(Bad Request) instead of 404(Not Found).

The error code is expected to be 404 as in the case of boot a server with non-existant image ID. Refer to the following commands for further clarity:

stack@ubuntu:~/devstack$ nova floating-ip-list
+--------------+-------------+----------+------+
| Ip | Instance Id | Fixed Ip | Pool |
+--------------+-------------+----------+------+
| 172.24.4.225 | None | None | nova |
+--------------+-------------+----------+------+
stack@ubuntu:~/devstack$ nova add-floating-ip 898c3ce0-5e06-4bbc-bb51-e165279aaa86 172.24.4.22
ERROR: Error. Unable to associate floating ip (HTTP 400) (Request-ID: req-66cc5a04-614a-40f8-8b9c-9dc9588422c8)
stack@ubuntu:~/devstack$ nova add-floating-ip 898c3ce0-5e06-4bbc-bb51-e165279aaa86 ''
ERROR: Error. Unable to associate floating ip (HTTP 400) (Request-ID: req-0e9bf557-1a3c-4e8d-8627-faf4211cddb5)

But while booting a server with non-existant image ID:

stack@ubuntu:~/devstack$ nova image-list
+--------------------------------------+---------------------------------+--------+--------+
| ID | Name | Status | Server |
+--------------------------------------+---------------------------------+--------+--------+
| 128c9458-211f-4d48-87d8-4812ab57f197 | cirros-0.3.0-x86_64-uec-kernel | ACTIVE | |
| ccc520d2-bb46-4253-bedd-aa7f2b86ccae | cirros-0.3.0-x86_64-uec-ramdisk | ACTIVE | |
| d506424f-d702-4a9c-b2f4-47d82f490671 | cirros-0.3.0-x86_64-uec | ACTIVE | |
+--------------------------------------+---------------------------------+--------+--------+
stack@ubuntu:~/devstack$

send: u'GET /v2/b84f99644c8b4fd494e21a57f71cc5b7/images/d506424f-d702-4a9c-b2f4-47d82f490672 HTTP/1.1\r\nHost: 10.233.52.237:8774\r\nx-auth-project-id: demo\r\nx-auth-token: ee674ddf6dd1433f94cc848bfb1ec3b5\r\naccept-encoding: gzip, deflate\r\naccept: application/json\r\nuser-agent: python-novaclient\r\n\r\n'
reply: 'HTTP/1.1 404 Not Found\r\n'
header: Content-Length: 62
header: Content-Type: application/json; charset=UTF-8
header: X-Compute-Request-Id: req-a2a29620-15e3-45f3-a949-8b738fbb8acc
header: Date: Fri, 27 Jul 2012 17:34:09 GMT