This patch updates the xattr image cache driver to use methods that are
more broadly compatible. The issue here is that there is more than one
xattr Python module out there. Specifically, there are:
https://github.com/xattr/xattrhttp://git.k1024.org/pyxattr.git/
The previous glance code expected an interface available in the first
version. This patch changes the code to use an interface that is common
to both of these.
This makes all of the image cache tests working against the current pyxattr
package in Fedora.
Change-Id: I1fca66cfe914364c921408b676a06387d1de5c2a
The first version of this patch fixed one misuse of 'self' when 's' was
expected. There were some other uses of 'self' that I missed. This
patch just changes these functions to use 'self' everywhere.
Change-Id: I66b74f00e5416e3e67eb60cf6c505f70134e6ddb
Fixes bug 773562
Allow the image data to be passed to glance.Client.add_add_image()
via an iterator, in addition to the previously accepted images types
(file-like or string).
Change-Id: I1f90b9875f5610d478a5ed123fbf431501f1c2b6
Fixes bug 853933
Add new --username|--password|--tenant|--auth_url|--auth_strategy
switches to bin/glance to allow the username, password, tenant name,
and authentication URL & strategy be specified on the command line.
Avoid needlessly falling back to keystone v2 auth after a successful:
GET /v1.0/tokens
returns with the X-Image-Management-Url or X-Glance header set,
as opposed to X-Server-Management-Url.
Extend the keystone functional test support to ensure that the URL
returned by keystone via the X-*-Url header contains the appropriate
dynamically allocated port for the glance API service.
Ensure the underlying $OS_* environment variables do not leak into the
TestPrivateImagesCli functional tests, also explicitly exercise both
noauth and keystone strategies.
Change-Id: Iee8bf3745d65a9c57a9da803d5cf9ae5f343a159
Fixes bug 852850
Ensure the glance API server will not start if the class supporting
the configured default store cannot be imported.
Change-Id: I80a97dbc0af4737dbbc1bf0491e7cef222ec3454
Don't allow an image size greater than 1 PiB. Also, add an exception
block catching and reraising HTTPError inside _upload. This way, we don't
fall into the Exception block below and log the full backtrace when the
error has been diagnosed already.
Adds unit test to verify 400 returned with supplied overlimit image size
Change-Id: Ie745dffaf2fe43fdb7643c27d087e36d76b7c0e4
Before converting to cfg, glance-control would use find_config_file() to
locate the servers config file if the user did not explicitly specify
it.
With the change over to cfg, we screwed that code up. However, we should
instead just allow the server to locate its own config file rather than
trying to guess what it will use.
Change-Id: I422839ae4c684ff2de3a0a96dd54c6b74ce6df97
Adds unit test to verify behaviour required:
* Location field may only be **edited** if the image is
in a queued state, which indicates that the user issued
a POST /images with NO location field and NO image data
* Otherwise, Location field may not be edited and may not
be read via the API server either.
Change-Id: I42aba7bc8e2da6ac81b18b564ba096208406f893
Fixes bug 919244. The registry would return 400 for invalid input,
which resulted in an exception.Invalid being thrown in the registry
client. There was no exception handler for this exception, so it
got bubbled up and turned into a 500. This should fix the problem
by adding the missing exception handlers.
Change-Id: I75ecfec1c0b0b4b3df1a8c9ace83e75d19527c93
Partially implements bp interim-glance-authz-service.
This checks basic image operations: get_images, get_image,
add_image, modify_image, delete_image. It looks for a
policy json file next to our config files.
Change-Id: I07f29c11934c68d38a6bdadd39f9dc841b61648a
Fixes LP #912897
When the remote store does not support deletion of images (e.g. HTTP)
the StoreDeleteNotSupported exception is now swallowed and logged as
opposed to it being propagated back to the glance CLI.
Also after a failed delete, we avoid falling through to the delayed
delete logic.
Change-Id: I6cc529f029750fc66a4d32e2076f29198b3d2093
Implements blueprint multi-process-server. Allows several Glance API
worker processes to be started, which can increase performance on machines
with more than one CPU.
Change-Id: I1cbb48945fd23afd71de3a30b80836b590c023a1
Previously the size metadata was always zero'd for remote images,
which was misleading and led to issues like:
Bug 900959
We now query the remote store (HTTP, S3 or Swift) with the
equivalent of a HTTP HEAD in order to determine the correct
image size without downloading.
Where the size is available, the metadata is set appropriately.
Otherwise it falls back to zero as before.
Change-Id: I3093eba1b2fa023348558c45febee39e68e1a08f
Add an optional paste_deploy.config_file variable to identify
a non-default location for the paste.ini file (the default for
/path/to/component.conf is /path/to/component-paste.ini).
Change-Id: Ibd7aefe95706fb50e4e353c14eb6dab0f948331f
Define multiple pipelines in glace-api.conf to reflect the
various supported deployment flavors (minimal, with caching,
with cache management, with keystone-based auth etc.).
Add an optional paste_deploy.flavor config variable to allow the
user select the appropriate pipeline without having to edit the
paste config (i.e. uncommenting lines as before). For example
in glance-api.conf, a setting of:
[paste_deploy]
flavor = keystone+caching
identifies the following pipeline in glace-api-paste.ini:
[pipeline:glance-api-keystone+caching]
pipeline = versionnegotiation authtoken auth-context cache apiv1app
the advantage being that the user need not be concerned with
the precise sequence of filters required to realize the QoS
they desire.
Modify the functional tests that patch configuration (i.e. the
keystone and caching tests) to use the new deployment_flavor
mechanism.
Extend the TestConfigOpts to support option groups.
Change-Id: Ide843ada11bce115b7dc650440397853c6409b03
This reworks the stubs.FAKE_FILESYSTEM_ROOTDIR used in unit
tests by making each test case create and destroy its own little
sandbox in /tmp/test.*/images. Adds a base IsolatedUnitTest that
tests needing to have an isolated filesystem_store_datadir and
configuration can inherit from.
Change-Id: I396f5127c6a687da8dcef3368e7ed0912efc9b3a
Override the image metadata size attribute with the actual
cached image file size when setting the Content-Length header
on the response to a GET of a cache remote image.
This avoids an non-initial GET on a remote image failing when
caching is enabled, as described in this bug:
Bug 900959
Change-Id: I7656bc971d982cce78ce1ed4cf7ea509f8bbdfa8
The existing code returns incorrect href= in the root document (aka
"version" document) if the default configuration is used. If a remote
system accesses Glance API, the netspec of href= contains 0.0.0.0,
which cannot be used for further remote accesses. This happens because
attempts to use local configuration or the bind address to reconstruct
URLs are futile.
The correct way resolve this problem is to use the Host: header
of the HTTP request. As a bonus, it works with IPv6, should we ever
support it.
Change-Id: I661351b679c695bd6ab310104a3246dd3069f9c6
Bug: 915621
Add a revision field to the version number to account for releases from
the stable branch, e.g. 2011.3.1.
See http://wiki.openstack.org/StableBranchRelease
Change-Id: Ibe3b69fcc7e7d09f17c8f6e68a0e7bb17afbfdce
Adds a functional test case that verifies that when an
image is deleted and the cache middleware is place, that
the image is properly removed from the image cache.
Change-Id: I20fc4461bd5f53528b264536b248f596aff510af
An image.send notification is to be sent to the notifier every time an image is
transmitted from glance. This can be used to track things such as bandwidth
usage.
Addresses bug 914440
Change-Id: If8b6504c4250fa6444d17d611de43d9704ca9aae
Remove the use of a temporary disk buffer when streaming to Swift. This
was added on the assumption that it was not possible to stream chunks to
Swift direct from webob.Request.body_file. That's not true -- a simple
file-like object wrapping body_file does the job perfectly.
This removes the need for swift_store_object_buffer_dir in the config file.
It is also significantly cheaper, since there is one copy fewer.
Fix the parsing of the swift_store_large_object_size and
swift_store_large_object_chunk_size options. These are
specified in MB in the config file, but needs to be in bytes internally,
because they are compared against the image_size parameter given to add().
Update the unit tests to match. This includes an additional check that
put_object is called the correct number of times. The unit tests missed the
latter problem problem because there was no check that a small object is only
uploaded in one chunk, and despite the comment to the contrary there was no
check that the right number of chunks were written in the large-object case
either. Added these in all places where store.add is called.
Change-Id: Ieb4cf68516b53bd16d2671e49e805b26118b3671
This change resolves 2 Fedora-related todo items in installing.rst.
It also cleans up a bit:
- fixes weird grammar
- fixes improper list numbering
- uses proper name for Red Hat, where space is necessary
- replaces A/B syntax with A, B
This is my first commit and I am adding myself to Authors file
on a suggestion by Brian Waldon.
Change-Id: I398ae8150d7912e0b61375a7bdc5aab1101f34bc
Use "python setup.py build_sphinx" instead. There are some things that
the Makefile did that setup.py does not do, but they will be easy enough
to add later if anyone misses them.
Change-Id: I430dcc027bac207af515fb7d927500db18320ba5