Instead of globally ignoring pyflakes and
hacking warnings, only blacklist those that trigger
very frequently so far, in order to clean them
up in followup commits. Fix and start gating
on the rest already.
Change-Id: Ied7c7250061e3bf379e8286e8ce3b9e4af817faf
Current glance command does not show the details of error message.
For example, the glance command shows HTTPBadRequest only if some
necessary parameter is not specified.
$ glance image-create --file root-fs.img --name cirros-0.3.0-x86_64-uec
Request returned failure status.
HTTPBadRequest (HTTP 400)
$
By only the above message, it is not easy that a user understand the reason
of an error. glance-api server returns the details of reason, but glance
command does not show it.
This patch adds details, which is gotten from glance-api server, to error
message. And a user will be able to understand the reason of a error like
the following:
$ glance image-create --file root-fs.img --name cirros-0.3.0-x86_64-uec
Request returned failure status.
400 Bad Request
Invalid disk format 'None' for image.
(HTTP 400)
$
Fixes bug 1094917
Change-Id: I49192c3ebbc8a70b63dcfcede9fd13f1688388cf
When using https verify that the Common Name (CN) or
the Subject Alternative Name listed in the server's
certificate match the host we are connected to.
Addresses LP bug 1079692.
Change-Id: I24ea1511a2cbdb7c34ce72ac704d7b5e7d57cec2
Use pyOpenSSL for HTTPS connections.
This allows:
* Neater loading of system CA files
* Optional disabling of SSL compression
The performance gain from disabling SSL compression is significant
in cases where the image being uploaded/downloaded is in an already
compressed format (eg qcow2).
Related to bp ssl-connect-rework.
Change-Id: I0568b6c95c5fc7b8eafdbd0284e24c453660a55a
If glance v1 api is not enabled, and a request is made to it,
it gives a KeyError. This patch catches the 300 error and
displays error message.
Fixes bug 1046607
Change-Id: I0009a5deca3b5dd5ccaeaea90feee21274bfe090
Expand exceptions to cover more failures cases. This adds
CommunicationFailure to represent any failures while attempting
to communicate with the remote endpoint. This also adds a new base
exception class BaseException which should be used for all non-HTTP
related failures.
Change-Id: Ie3e1d45c520d816a3f491a85fde94a6c4edf295e
* Refactor helper function that builds the map of http status codes
to local http exceptions - now we don't have to explicitly list
every single exception name
* Add several exceptions to represent http status codes that were not
previously represented
* Improve consistency of exceptions naming by prepending 'HTTP' to
necessary exception names
* Use HTTPException instead of ClientException
* Deprecate old http exceptions (those that aren't prefixed with HTTP)
* Deprecate ClientException
* Deprecate unused NoTokenLookupException and EndpointNotFound
* Add test module to spot-check the from_response helper
Change-Id: Ibc7fef9e2a5b24bd001d183d377901f302d650a9
We don't need to look at the container of available schemas in order
to get the one we want. Remove glanceclient.exc.SchemaNotFound as it can
no longer be raised.
Change-Id: Ib49ad58c4fdfc9bc9f535115674d92040a97db65
A few files were missing copyright headers:
* glanceclient/common/http.py
* glanceclient/v1/__init__.py
* glanceclient/exc.py
Change-Id: Ibbd53cd49f9367994de66a30601b3aefe1a8d6ee
Add glance.exc.InternalServerError and .ServiceUnavailable to
represent HTTP statuses 500 and 503. Users will definitely see
these from Glance, so let's be nice and map them to handy
exception classes.
Change-Id: I8e8fcda532455793ea4d0f08a23f7c92b68c186c
* This allows us to send truly chunked responses to users
* Handle bad connection url schemes with a new InvalidEndpoint exception
* Fixes bug 1023240
Change-Id: I34500987f51d4e0c6e1f89ecf93853de3fcbb1c3
* Consumers of this client should not depend on being able to import
any module other than glanceclient and glanceclient
* The only attributs of the glanceclient module are Client
and __version__
* The attributes of the glanceclient.exc modules have yet to be
locked down
* glanceclient.common.exceptions was replaced with a placeholder
module until consumers of it are updated
Change-Id: Iea9648cd06906d65764987c1f2ee5a88ebeee748