nova services API is incompatible w/ novaclient

Bug #1147746 reported by Dan Prince
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
High
Dan Prince
python-novaclient
Fix Released
Undecided
Hans Lindgren

Bug Description

The Nova services API extentsion which we added in Grizzly is internally inconsistent and also doesn't quite match what we are doing in novaclient either.

Novaclient sends a request that looks like this:

REQ: curl -i http://localhost:8774/v1.1/99d907eceb0846b4b07d56458063fc7f/os-services/disable -X PUT -H "X-Auth-Project-Id: admin" -H "User-Agent: python-novaclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: 171ca63833e5489486608448406c07f8" -d '{"binary": "nova-cert", "host": "nova1"}'

But our services extension currently expects the {"service": "nova-cert", "host": "nova1"} format.

I actually think novaclient is correct in this regard because our index format for os-services uses 'binary' as well. For example:

[root@nova1 v1_1]# nova service-list
+----------------+-------+----------+---------+-------+----------------------------+
| Binary | Host | Zone | Status | State | Updated_at |
+----------------+-------+----------+---------+-------+----------------------------+
| nova-cert | nova1 | internal | enabled | up | 2013-03-05T21:14:39.000000 |
| nova-compute | nova1 | nova | enabled | up | 2013-03-05T21:14:38.000000 |
| nova-network | nova1 | internal | enabled | up | 2013-03-05T21:14:44.000000 |
| nova-scheduler | nova1 | internal | enabled | up | 2013-03-05T21:14:41.000000 |
+----------------+-------+----------+---------+-------+----------------------------+

So I think the thing to do is make the os-service update format consistent with what the index format uses (and returns) and then novaclient should work as well.

Dan Prince (dan-prince)
Changed in nova:
assignee: nobody → Dan Prince (dan-prince)
status: New → In Progress
importance: Undecided → High
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/23616

Joe Gordon (jogo)
Changed in nova:
milestone: none → grizzly-rc1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (master)

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

Changed in python-novaclient:
assignee: nobody → Hans Lindgren (hanlind)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/23616
Committed: http://github.com/openstack/nova/commit/37c618da7c565b13cf6779f40c41ce895ff0459f
Submitter: Jenkins
Branch: master

commit 37c618da7c565b13cf6779f40c41ce895ff0459f
Author: Dan Prince <email address hidden>
Date: Tue Mar 5 16:17:29 2013 -0500

    Make os-services API extensions consistent.

    Updates the os-services API extension so that it is consistent
    internally (index and update return similar formats), and so
    that it works with the recent novaclient code which sends
    the following request body format:

      {"binary": "nova-cert", "host": "nova1"}

    Also, updates the response body format of the update call so that it
    wraps things in an extra service dict which should make novaclient
    happier here as well (and is consistent with other extensions too).

    Fixes LP Bug #1147746.

    Change-Id: I932160d64fdd3aaeb2ed90a092ecc7a36dcc9665

Changed in nova:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-novaclient (master)

Reviewed: https://review.openstack.org/24158
Committed: http://github.com/openstack/python-novaclient/commit/b94fbf59a2899cf08116c6f1e4eb3c4cec8666df
Submitter: Jenkins
Branch: master

commit b94fbf59a2899cf08116c6f1e4eb3c4cec8666df
Author: Hans Lindgren <email address hidden>
Date: Tue Mar 12 10:52:27 2013 +0100

    Make os-services API extensions consistent with Nova

    Updates the os-services API extensions to match the Nova changes
    proposed in I932160d64fdd3aaeb2ed90a092ecc7a36dcc9665.

    Resolves bug 1147746.

    Change-Id: Ib0f24dea8e937a8e1a1604b1cbf19d96bcdbcd8f

Changed in python-novaclient:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in nova:
milestone: grizzly-rc1 → 2013.1
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-novaclient (master)

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

Changed in python-novaclient:
status: Fix Committed → Fix Released
Revision history for this message
Akira Yoshiyama (yosshy) wrote :

The fix for python-novaclient doesn't look released. Please confirm it.

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.