This allows functions that do not accept bodies to define this in the
router file. As currently many requests will cause a 500 if a body is
supplied when the API request does not expect it.
This currently only affects the core parts of the v2 api, that is,
calls to v2/images and v2/schemas. It does not cover the "tasks" API
or the metadefs api as I was keeping this patch concise. As this
does not affect the behaviour if not included this makes no change to
the metadefs api behaviour.
DocImpact
Partial-Bug: 1475647
Change-Id: Ieb510e5516128078d40d39fd9b4f339ce64e10e7
* urlsafe_b64decode(): on Python 3, decode from ASCII to get Unicode
string.
* urlsafe_decrypt(): encode Unicode to UTF-8.
* in some loops, copy dictionary keys or items because the dictionary
is modified in the loop body.
* test_api: use byte string for image content, not Unicode
* test_registry_api: HTTP body type is bytes, use byte strings and
jsonutils.dump_as_bytes(), instead of native strings and
jsonutils.dumps()
* tox.ini: add glance.tests.unit.v1.test_registry_api to Python 3.4
Change-Id: Ib9d18dce6e5728b9adf094b5aae64a86a3fea71a
When unit tests are launched some of these tests are attempting
to access http://example.com. This is not convenient in case
if somebody doesn't have an access to internet.
In order to fix this
- some tests in test_script_utils were deleted
cause they tested urllib instead of glance
- Some responses were replaced with FakeHTTPResponses
- Some requests were redirected to local http server
Change-Id: I66c3d67ae4bff474a4ef5a2d5469cfe04f36cdf9
Closes-bug: #1508868
* Decode HTTP body from UTF-8 to get Unicode on Python 3. The test
still works on Python 2.
* tox.ini: add test_cache_manage to Python 3.4.
Change-Id: I637732cb06b7ae30853b35d2a83aa85f643fd43b
* Replace filter() with list-comprehension to get a list on Python 3.
* HTTP body type is bytes: use byte strings for body.
Change-Id: Ia7fba4b075cdedd4581e4e8503f5220c1e6198d7
For each image, when user clicks on Edit Image --> Update Metadata, the list
of various available metadata categories and properties is displayed in a
pop-up window. For each category and property, a user-friendly description is
displayed at the bottom of the pop-up.
The description for "Common Operating System Properties" category says - "When
adding an image to Glance, you may specify some common image properties that
may prove useful to consumers of your image." This is too generic and seems
like a copy-paste of the description from glance-common-image-props.json that
the author later failed to update.
Fixing this to show a more meaningful message.
Change-Id: I5477b1702932e07ab1fd499204d3ff1348abba3b
Closes-Bug: #1483063
The package is actually named glance_store, not glance-store. This is
known to cause errors in old pip versions and with non standard setups,
so lets name it correctly.
Change-Id: I060d60b3df41c35311329835a17870acb112de9b
We depend on glance_store in requirements.txt so there is no reason to
also depend on it as an extra.
Change-Id: I8c91a7c21247fb52cb777d3ab94cd1c7eee22adc
* Replace exc.message with six.text_type(exc). The message attribute
of exceptions was removed in Python 3.
* set_image_data(): replace "isinstance(data_iter, file)" with
"hasattr(data_iter, 'close')". The file type is gone in Python 3,
use duck-typing instead to check for the close() method.
* Use bytes instead of Unicode strings for image content. Replace
cStringIO() with BytesIO().
* Fix data iterator: use a list of strings instead of a string.
* tox.ini: add the following tests to Python 3.4
- glance.tests.unit.async.flows.test_convert
- glance.tests.unit.async.flows.test_import
- glance.tests.unit.async.flows.test_introspect
- glance.tests.unit.async.test_taskflow_executor
Change-Id: I885e11c0da1a264456fdeb2bff54dcfd3acfd193
When the registry has an error validating the token that the api
has sent it a 500 is returned rather than 401. This fix catches the
NotAuthenticated exception and throws an HTTPUnauthorized instead.
Change-Id: I405cd98346e2df06c02e37bfdf903a54a29f7b19
Closes-bug:1504184
New image metadata can be added by creating a new json file in the directory
glance/etc/metadefs (this metadata shows up in the image metadata UI on
Horizon dashboard). If the file is loaded successfully, a log message like
the following is printed:
2015-08-09 11:48:34.713 INFO glance.db.sqlalchemy.metadata [-]
File /etc/glance/metadefs/operating-system.json loaded to database.
However, if there is an error loading the file, we get a log message like:
2015-08-09 11:48:34.875 ERROR glance.db.sqlalchemy.metadata [-]
Expecting , delimiter: line 15 column 9 (char 579)
In other words, the file name is not printed. Printing the file name in the
error message will make it easier to debug as we can search the logs using
the file name.
Change-Id: If72fdbb00c58e42aa128ab2b4461a2ae8e55c5aa
Closes-Bug: #1483049
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
iQIcBAABCAAGBQJWH6wMAAoJEFB6+JAlsQQjY24QALJY9T2pprpAbp6ZoMrMGyct
QOg/piILNXN43Sac0lxoJC6PAp1SVT9ljWbAQ8xeSwnuAWG7C0kke1p/1k2BA73I
y3e3Iw7a5whH2VWiU6Mt8g9qoc3pAyhMhns9LYFTrheiRDWXSTvC+t5wMw01oMw/
smXy4lI5j8bB8blSmuFHYBdpIq1C+Qolpz5CoaXO4yZi+mo84gb5jPJxM98fSENU
pdYpWYoNZiTtnkkbBUaBLJ8XeBPtmw5t9tSPscM3kIDKN2FE+48scaDl1wI5W/6m
53JbPWdvE1fdFB2/OKXa5TRHihygEsa8qZIg75lTt7YtAtrneEZ6JnVGA7irIDBp
nlKdyfjGhKRv91sB3GLAOnJfCeJBH9eYQKQVXWKhTSnoyZafKuytlCMvgEfSwPpv
Ogn85Z1OmZcmB+b3/e5TxuEbwQNggjT3+rtw9WJ4Sb2G/caFQUIP1g5DG+JNP1nC
v+6HBvq5OGnlR+Sjv1Lg/LGowebP0It9USfnN4PMma0NLADoXfmBp7uF+0nCb+1T
gIITsd+t0bKguoQiY7LQm72hUWMvNo1JJs7R0yir3J0/TOCL/pPvkiuDNod13s8Y
xpUCEZLy0H9u7+A5TAgEOztT9JeKs9E5cUyvSKga09uehExezVNrBGlZ8gib3lV8
FiD0qvjiZe7TRCtuUJjh
=sRVk
-----END PGP SIGNATURE-----
Merge tag '11.0.0'
This is a null-merge of the 11.0.0 release tag back into the master
branch so that the 11.0.0 tag will appear in the git commit history of
the master branch. It contains no actual changes to the master branch,
regardless of how our code review system's UI represents it. Please
ask in #openstack-infra if you have any questions, and otherwise try
to merge this as quickly as possible to avoid later conflicts on the
master branch.
Change-Id: Iff3a4a4547842167443e507a739d839e750e1ef9