Extend rest api v2 with multiple sort keys support.
Example:
/v2/images/detail?sort_key=name&sort_key=size
Changed database api which now takes sort_key param as a list instead of string
python-glanceclient support will be added in separate commit
Change-Id: Ib7a6aeb2df3bc5d23fe8e070290b5bfcab00c0f5
DocImpact
Partial-Bug: 1221274
Since v2 api has no sort key validation and the default
pagination check is used it's possible to request something
like /images?sort_key=_sa_class_manager, which causes an
inner SQL exception with 500 response code from the server.
This code validates input sort key and raises an exception
if the parameter is out of the supported keys list.
Closes-bug: 1400366
Change-Id: I0cf58ad198375a2f6f58bd7820cbb9d86003247a
If dnspython is present in the environment then eventlet
monkeypatches socket.getaddrinfo() with an implementation
which doesn't work for IPv6.
This patch has also been applied to other Openstack
projects such as nova (f2e49ad3) and keystone (3afd9791)
in order to work around the same problem and is
intended to be used in the same way.
Co-authored-by: Hui Xiang <hui.xiang@canonical.com>
Closes-Bug: 1331885
Change-Id: I795e004eac3f032217ff9cb0047f1976306fbb71
Currently, Glance's API v2 doesn't return fields whose value is None.
This, unfortunately, is wrong for a client perspective since it would
create inconsistencies between calls and images due to the lack of
fields in the response.
The API should guarantee consistency in its replies and ensure all
fields have a value, even if it's None.
NOTE: This work is part of the migration to v2. It fixes inconsistencies
in the API and improves the interaction between the client library and
Glance.
NOTE2: A follow-up patch will bump the minor API version, wait for it.
ApiImpact
DocImpact
Closes-bug: #1398314
Change-Id: Ieaddd8a686cf7361f18cb1ee83b7887cdca22bd6
Some fields are not required parameters, therfore this patch allows them
to be None.
This has been done for images in a previous patch. This patch does the
same thing for tasks.
This will allow the client to have attributes with value `None` and
it'll make it consistent across responses and with regards to the API.
NOTE: A follow-up patch will enable None values to be returned by the
API.
Change-Id: I694cc144375c76ad8aaab495fc2e3ac5ed84ec2f
Container, disk format and checksum - among other fields - are not
required parameters, therfore this patch allows them to be None.
This will allow the client to have attributes with value `None` and
it'll make it consistent across responses and with regards to the API.
NOTE: A follow-up patch will enable None values to be returned by the API.
Closes-bug: #1398313
Change-Id: I75da1e9309e0f7ef8839dea3ec9c99c58edc5d63
It fixes some eyesores that have been found in glance domain:
1. Removes duplicate declaration of a varariable 'name'
2. Changes type of several image transitions from 'str' to 'tuple'
3. Sets the correct default values to tags and extra_properties
4. Changes strange constructions like
self.tags = kwargs.pop('tags', None) or [] to
self.tags = kwargs.pop('tags', [])
Change-Id: I9309c7dc70b9910c6c09111f26ee489fa7ab9260
This could cause issues when upgrading to juno, since if config files are not
updated osprofiler can crash.
It is disabled by default in other services, such as cinder and heat.
Change-Id: Ide1be0d42e9e3640560564005b2ce1ffdf554e25
Closes-Bug: #1387320
This is the relevant change on glance side. The main change on
glance_store side is Ic4423405f831088fb51de7cfdf1243e9a0ff32ea ,
which be used to allow glance_store exception provide a proper error
message instead of None message all the time.
Note, once the change on glance_store side get merged, we need to land
this for glance before release new glance_store.
Change-Id: I0d6aa29bca3809da4c71d278ef17897eae15ee6c
Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
Glance does not support Python 2.6 anymore starting with Kilo and might
not work correctly with it, so remove the classifier.
Change-Id: Ibd7ad401198749f975fb19007549f7623caae546
Image create or update with params containing 4 byte unicode characters
results in 400 server error code (instead of former 500).
Image name/location/tags/properties are validated this way
Change-Id: Ib0fcf2456f0996e8235983b361d1ee5f66136375
Closes-bug: #1370954
* Rename rally-scenarios directory to rally-jobs. Because actually
this directory contains files related to job and not scenarios.
* Upadte main README file
* Add readme files to rally-jobs/extra and rally-jobs/plugins
Change-Id: I111c3c3f86ab4886d3a7b66c7bf7c050c1d9ca1a
The builtin _ should not longer be used. Instead _
should be explicitly assigned from glance.i18n.
This patch does the following:
(1) adds these explict assignments to any
glance file that was missing them,
(2) removes the defintion of _ as a builtin from
tox.ini so that a pep8 failure will occur
if _ is not defined,
(3) removes calls to install().
This removes the last direct use of gettextutils by glance.
The indirect uses, via openstack/common, will be removed
in the next sync with oslo.
Change-Id: Ie54e8a67e747e022cc01022dfad35d89686bdfc4
Changing all Glance files to use i18n instead of gettextutils for log
translations.
Finishes bp refactoring-glance-logging
Change-Id: I90d6ab4f7e09f4e7591921f9526de6370ebdb789
This change complements glance change #106776 by raising some logging
levels and fixing some of the translations of logging.
Related to bp refactoring-glance-logging
Closes-Bug: #1336955
Change-Id: Ib547f4603025ebe4f6c055779032ab4064784490
Several metadef module routines use:
from wsme.rest.json import fromjson
from wsme.rest.json import tojson
To follow the import rules at http://docs.openstack.org/developer/hacking/
(only import modules), these should be replaced with:
from wsme.rest import json
Change-Id: Idc496c8753d93a3d39f0c9cbbb31205948eeb081
Closes-bug: 1392485
Args of assertEquals method in glance.tests are arranged
in wrong order. In result when test fails it shows incorrect
information about observed and actual data. It's found more
than 2000 times. Right order of arguments is "expected, actual".
Change-Id: Ifea4809f5a696b608a19e36a9ed9e5eec46c8a21
Co-Authored-By: Li Yingjun <liyingjun1988@gmail.com>
Closes-Bug: 1277104
Sample file (etc/logging.cnf.sample) is not needed anymore,
since we use openstack common logging now. So, I am removing this file from
Glance repository.
Closes-Bug: #1163075
Change-Id: I7b769998983f34840d525bd3ead4dc38e03f4602
Latest glanec_store release added a new `context` keyword to some
functions. This broke backwards compatibility for some of the tests in
master and juno.
This change adds the corresponding keyword to the mock calls.
Closes-bug: #1391437
Change-Id: I5e58462e4c076b3ea56e27361eb6c3b0aafa2493
Exception declarations should be stored in
glance/common/exception.py.
This patch transfers UploadException there and replaces other
duplicate exceptions with standard counterparts from webob.
Change-Id: Ifbb2c22c4360067e22af37b4439ff5eff93e4073