This change removes option to configure Images API v1
This change removes Images API v1 endpoints from the router
This change removes all v1 tests
This change removes the v1 dependant glance-cache-manage command
This change does not remove all v1 codebase. Further cleanup and
decoupling will be needed.
Change-Id: Ia086230cc8c92f7b7dfd5b001923110d5bc55d4d
This code prevents the occurrence of 501 error when
accessing the server with a non-existent method.
Change-Id: I1105ed1399f1bcde7f1f970abcad929585fd012e
closes-bug: #1470192
Requests for resources with an unsupported HTTP method now return a HTTP
response 405 (Method Not Allowed) or 501 (Not Implemented) rather than a
404 (Not Found) for everything.
For example, attempting to DELETE on /v2/images will now return a 405
instead of a 404 and will provide a response header 'Allow' that lists
the valid methods for the resource.
Attempting to use NON_EXISTENT_METHOD on /v2/images will now return a
501.
Attempting to GET on /v2/non_existent_resource will, as expected, return
a 404.
Fixed for v1 and v2.
Change-Id: I5406f8ee423d3d5e66c56a26a7009b4f438a7e0f
Closes-Bug: #1297362
Currently, a HEAD images/detail request goes through the images/{id}
route which leads to a 500 response status.
This HEAD method should be handled separetely in order to return a
405 Method Not Allowed response and suggest GET as an allowed method.
Change-Id: Ic83e819189bcff7c4735af476217a9ed1e4f41b8
Closes-Bug: #1297358
For image members v1, we don't support "create" method,
but we're mapping it in router.py. So this fix will
remove the unused mapper.
Fixes bug 1223658
Change-Id: I20401656ea2930a026cf8b67825d9ec9f6623487
When using the routes mapper's collection to map from URLs to
python functions several additional URIs are created by
default: 'new', 'format' and 'edit', eg this URI
/v1/images/new
was accessible and would return a '500'.
/v1/images/detail.xxx
was accessible and a 'GET' to it would create a file called 'detail.xxx'
in the image cache directory (where 'xxx' is an arbitrary string).
Similar resources for image memberships existed.
Other collection URIs (for both the API and Registry) would return
unexpected behaviour.
Use explicit mappings rather than a 'collection' to remove
the superfluous resources.
Fixes bug 1185828.
Change-Id: I2f451f0208d43cdc83dcf58a41ea31359b18fcf2
Use LOG for variable name and __name__ for logger name. Also
document this fact in HACKING.rst
Fixes bug 1015685
Change-Id: I0d9d80bef66197a28ed3d650f17859202048d776
Implements blueprint cfg-global-object
In glance.common.wsgi we have a paste_deploy_app() API which allows
a ConfigOpts instance to be passed the the applications and filters
constructed by PasteDeploy.
Now that we're using a global object, we don't need this anymore
Change-Id: I222d3c58308bc2f504cd802c0c8405d3baa2e49a
Implements blueprint cfg-global-object
This iteration fixes up the remaining places where we're passing a
conf object around.
Change-Id: I3b627d093a6b7afeee129ab66b377a3b0af5439b
The changes here are substantial and widespread, but in summary:
- We use cfg to parse the CLI and config files, rather than optparse
and PasteDeploy
- A schema is defined for all configuration options close to the code
which uses the option
- 2 ConfigOpts sub-classes are added to config.py basically just
defining how to find config files; this means we can now use e.g.
glance.conf for base config values which glance-api.conf can
override
- load_paste_app() is changed to load the paste app from the last
config file in the stack and pass the app the ConfigOpts instance
- The generic app and filter factories in wsgi.py are modified to
pass a ConfigOpts instance to the apps and filters
- A ConfigOpts subclass is added for the unit tests which writes out
config values to a temporary config file and uses cfg to parse that
I've tried to keep the switch as unobtrusive as possible leaving further
cleanups for later e.g.
- Moving PasteDeploy config out of the config files - I think it would
be good to aim for having users modify the PasteDeploy config files
only in fairly rare circumstances. To achieve this, we might define
a number of common pipelines in the PasteDeploy config and allow
the user to choose between those pipelines in the glance config.
- We should add help strings to all the opts, even just for the sake
of documenting them
- We should move a bunch of the options into groups - e.g. all the
rabbit options
- We no longer rely on config files for default values, so the default
config files could contain nothing but comments - i.e. explaining
each option and showing what the default for it is - making it
obvious where a user has explicitly set a value
There are a couple of behavioural changes which I don't think are
signifcant but are worth mentioning:
- We used to support passing a config file as a positional argument
but don't anymore; AFAICT, it was only used by glance-manage when
launching servers and I've changed that to pass --config-file
- log_opt_values() doesn't log unknown opts, so won't log any values
for opts which get registered at runtime later
Change-Id: Iafa998a2a8d860f1ad57e2cd2afee69686ed58ba
In the common-config patch, I'm going to be using 'conf' as the name of
the variable holding configuration values rather than 'options.
This patch does the renaming across the codebase without making any
functional changes.
Change-Id: I3a86fc01fc76825d6d1e86af882eb8245828ce5f
These generic factories allow us to dump the copied and pasted
app_factory and filter_factory methods in the codebase.
The main difference is the paste configuration changes from:
[app:apiv1app]
paste.app_factory = glance.api.v1:app_factory
...
[filter:cache]
paste.filter_factory = glance.api.middleware.cache:filter_factory
to this:
[app:apiv1app]
paste.app_factory = glance.common.wsgi:app_factory
glance.app_factory = glance.api.v1:API
...
[filter:cache]
paste.filter_factory = glance.common.wsgi:filter_factory
glance.filter_factory = glance.api.middleware.cache:CacheFilter
Apart from reducing code duplication, this will also allow us to have
the generic factories inject other data into the apps and filters.
Change-Id: I1d2be5630ab61d29b8948ff88d58e6e1b11c2e5f
This patch addresses the dependency proliferation in
the glance client stuff. It removes references to modules
that contain non-client-necessary libraries (like
eventlet, xattr, sqlalchemy-migrate and sqlalchemy)
by restructuring the modules slightly.
Note that the additional httplib2 dependency is because
that is used in the authentication strategy stuff in
glance.common.auth. This could be rewritten to use httplib
instead, further reducing the dependencies of the client lib.
IMPORTANT NOTE: This patch changes the default entrypoint
for the Images API router application, and therefore this
should be merged along with the packaging changes in this
branch:
https://code.launchpad.net/~jaypipes/glance/ubuntu/+merge/82318
Change-Id: I5dbc8584fb77e3e011fb6ff3532f792f5103e242