47423ebbb2dfcb0d63aefcb87a9bec85420a7a99

We have a basic implementation for a fallback mechanism that will use v1 rather than v2 when downloading schema files from glance-api fails. However, this is not sound. If the schemas are cached already, we won't check if v2 is available and fail to fallback. This patch fixes the aforementioned issue by getting the list of available versions from the server only when the API versions was not explicitly specified through the CLI. That is, for all commands that don't pass `--os-image-api-version 2`, we'll check v2's availability and we'll fallback to v1 if it isn't available. This patch also changes how we handle `/versions` calls in the client. The server has been, incorrectly, replying to requests to `/version` with a 300 error, which ended up in the client re-raising such exception. While I think 300 shouldn't raise an exception, I think we should handle that in a spearate patch. Therefore, this patch just avoids raising such exception when `/version` is explicitly called. This fallback behaviour and the check on `/versions` will be removed in future versions of the client. The later depends on this bug[0] being fixed. [0] https://bugs.launchpad.net/glance/+bug/1491350 Closes-bug: #1489381 Change-Id: Ibeba6bc86db2a97b8a2b4bd042248464cd792e5e
Python bindings to the OpenStack Images API
This is a client library for Glance built on the OpenStack Images
API. It provides a Python API (the glanceclient
module) and
a command-line tool (glance
). This library fully supports
the v1 Images API, while support for the v2 API is in progress.
Development takes place via the usual OpenStack processes as outlined in the developer guide. The master repository is in Git.
See release notes and more at http://docs.openstack.org/developer/python-glanceclient/.
- License: Apache License, Version 2.0
- Documentation: http://docs.openstack.org/developer/python-glanceclient
- Source: http://git.openstack.org/cgit/openstack/python-glanceclient
- Bugs: http://bugs.launchpad.net/python-glanceclient
Description
Languages
Python
99.7%
Shell
0.3%