--os-image-api-version 2 behaviour inconsistent
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Glance Client |
Fix Released
|
Medium
|
Flavio Percoco |
Bug Description
If only v1 is available and the schema has been cached, then this command will produce:
$ glance --os-tenant-
HTTPMultipleChoices (HTTP 300) Requested version of OpenStack Images API is not available.
If the schema is not cached, the behaviour is:
$ glance --os-tenant-
WARNING: The client is falling back to v1 because the accessing to v2 failed. This behavior will be removed in future versions
+------
| Property | Value |
+------
| checksum | a16a81de3d944eb
| container_format | bare |
| created_at | 2014-07-31T12:48:53 |
| deleted | False |
| disk_format | raw |
| id | d6bc96f0-
| is_public | False |
| min_disk | 0 |
| min_ram | 0 |
| name | x |
| owner | 61624292678963 |
| protected | False |
| size | 1048576000 |
| status | active |
| updated_at | 2014-07-31T12:49:47 |
+------
If the user explicitly selects the API version on the command line (--os-image-
tags: | added: 1.0.0-potential |
Changed in python-glanceclient: | |
status: | Triaged → Fix Committed |
Changed in python-glanceclient: | |
milestone: | none → 1.1.0 |
status: | Fix Committed → Fix Released |
Overall, I think the behaviour should be:
glance --os-image- api-version 1 ... -> fail if version 1 is not available api-version 2 ... -> fail if version 2 is not available
glance --os-image-
glance ... -> The user has expressed no preference. Query the endpoint to see if v2 is available -- if so, use it. If not, is v1 available? If so, use it.
It's important that if a user explicitly selects an api version that we fail if that version is not available.
For example an operator may have monitoring scripts such as:
script 1: api-version 1 ...
# ensure v1 is responsive
glance --os-image-
script 2: api-version 2 ...
#ensure v2 is responsive
glance --os-image-
if 'script 2' works by falling back to v1 in this case there's no way for the operator to use the client cli to verify v2 is alive.