Required options should be listed as required and error when not provided.

Bug #1309272 reported by StackForge Gerrit
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance Client
Fix Released
Undecided
Gorka Eguileor
Kilo
New
Undecided
Unassigned

Bug Description

I recently did a `glance image-create --name 'foo' --file 'foo.img' --disk-format 'qcow2'` and neglected to provide --container-format. Instead of failing immediately and telling me I must provide a container format glance client happily spent a few minutes copying bytes to a glance server then after all bytes had been copied I was told that None is not a valid container-format.

Glance client should make --container-format a required argument to image-create. I would fix this myself but after looking at the code I have realized that many other args and options are probably required too and I don't have a good way of building then correcting that list. So I am just going to add a bug.

If someone does have a list I am happy to take a stab at fixing this more properly.

Revision history for this message
vikash irrinki (vikash-irrinki) wrote :

is it ok if we take container format as 'bare' if not mentioned?

Gorka Eguileor (gorka)
Changed in python-glanceclient:
assignee: nobody → Gorka Eguileor (gorka)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-glanceclient (master)

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

Changed in python-glanceclient:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-glanceclient (master)

Reviewed: https://review.openstack.org/163584
Committed: https://git.openstack.org/cgit/openstack/python-glanceclient/commit/?id=8d118ccedc7e0544ec21e1fbb7f1b8b3a4f03715
Submitter: Jenkins
Branch: master

commit 8d118ccedc7e0544ec21e1fbb7f1b8b3a4f03715
Author: Gorka Eguileor <email address hidden>
Date: Fri Mar 13 17:47:09 2015 +0100

    Require disk and container format on image-create

    Currently glanceclient doesn't enforce disk-format or container-format
    presence in the command line on image-create when providing image data
    (with --file, --location, --copy-from), which means that the POST
    request is made with the whole image and error is reported by Glance
    API.

    This post enforces presence of those arguments when image data is
    provided so we can get the error quicker and avoid sending unnecessary
    data over the network.

    Change-Id: I5914fa9cfef190a028b374005adbf3a804b1b677
    Closes-Bug: #1309272

Changed in python-glanceclient:
status: In Progress → Fix Committed
Changed in python-glanceclient:
milestone: none → 1.0.0
status: Fix Committed → 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.