image-create-via-import needs to fail faster
This bug affects 1 person
| Affects | Status | Importance | Assigned to | Milestone | |
|---|---|---|---|---|---|
| Glance Client |
Fix Released |
High |
Brian Rosmaita | ||
| Queens |
Fix Released |
High |
Brian Rosmaita | ||
Bug Description
The image-create- via-import command needs to make sure that it has all and only the correct inputs for the requested method before it performs any actions. Otherwise you get a situation where both a --file and --uri can be specified with no import-method (or with glance-direct, the default), an image record is created and staged but the do_image_import function later fails (because it has a uri and the method is not web-download -- do_image_import must do the check in case it's being invoked directly).
Sure, this can be fixed by making another import call directly, but that presupposes that the user knows how to do it correctly, which is doubtful since they already messed up the create-via-import call. It's better if create-via-import does nothing if the inputs it gets are incorrect. Otherwise, lots of calls to support and sad operators.