trove cluster-create error incorrectly references instances argument

Bug #1461604 reported by Amrith Kumar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-troveclient
Fix Released
Undecided
Amrith Kumar

Bug Description

$ trove cluster-create c1 mongodb 2.4.9
ERROR: Validation error: cluster 'instances' is a required property (HTTP 400)

The argument is --instance

affects: trove → python-troveclient
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-troveclient (master)

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

Changed in python-troveclient:
status: New → In Progress
Revision history for this message
Peter Stachowski (peterstac) wrote :

I think this may be because the --instance arguments are compiled into an 'instances' reference in the cluster structure, and oslo seems to not send 'None' if nothing is supplied - it just doesn't send it. This means that the server sees that 'instances' isn't set, not that it's empty (I know, semantics, but it's what generates the 'required property' not found error).

Probably the best way to print a nicer error is to trap this case in the client.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on python-troveclient (master)

Change abandoned by amrith (<email address hidden>) on branch: master
Review: https://review.openstack.org/207842
Reason: makes sense.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-troveclient (master)

Reviewed: https://review.openstack.org/207842
Committed: https://git.openstack.org/cgit/openstack/python-troveclient/commit/?id=398bc8e1d7b31e414652305199b4c5986faf9acc
Submitter: Jenkins
Branch: master

commit 398bc8e1d7b31e414652305199b4c5986faf9acc
Author: Amrith Kumar <email address hidden>
Date: Sun Jul 12 00:51:24 2015 -0400

    Error message on cluster-create is misleading

    When you execute cluster-create without specifying an instance, the
    error generated by Trove API service accurately reflects the error in
    the API call. In the API, the instance information is an 'instances'
    parameter.

    However, on the command line, cluster-create accepts an argument that
    is --instance. Therefore the error message coming from the Trove API
    service (which reads ERROR: Validation error: cluster 'instances' is a
    required property (HTTP 400) is misleading.

    It is also not very meaningful for the client to knowingly send an
    incomplete request to the server to be told that it is
    incomplete. Instead, the client now just validates this and prints a
    meaningful message for the user.

    This does mean that the Trove client still has a --instance argument
    while the API has an instances collection; both of which are
    meaningful.

    Closes-Bug: #1461604

    Change-Id: I2a6b9c206c8676141b962e2d0602d77962c9e4dd

Changed in python-troveclient:
status: In Progress → Fix Committed
Changed in python-troveclient:
milestone: none → 1.3.0
status: Fix Committed → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-troveclient 1.3.0

This issue was fixed in the openstack/python-troveclient 1.3.0 release.

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.