summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge "CLI image-update gives a wrong help on '--tags' param"0.14.1Jenkins2014-09-191-1/+1
|\
| * CLI image-update gives a wrong help on '--tags' paramZhi Yan Liu2014-07-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The help message tells end user image-update interface accepts 'tags' param and could be used to update tag of image [0], but actually it could trigger an 400 exception [1] due to wrong PATCH calls, and the correct way is to use image-tag-update interface [2] as designed. [0] glance image-update <IMG_ID> --tags <TAG_VALUE> [1] 400 Bad Request Invalid JSON pointer for this resource: '/tags/0' (HTTP 400) [2] glance image-tag-update <IMG_ID> <TAG_VALUE> Change-Id: Iaa8041779510192dc08f7b898b8a1beda29a6398 Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
* | Merge "Downgrade log message for http request failures"Jenkins2014-09-171-1/+1
|\ \
| * | Downgrade log message for http request failuresChris Yeoh2014-08-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Downgrades the log message when an http request fails from error to debug. The logging level changed in the http.py upgrade in I09f70eee3e2777f52ce040296015d41649c2586a which effectively reverted a similar fix commited in I6d0efb53d1e81adf309f7fa580ec5a8073a811c5. We don't want to log at ERROR level because we already have an exception raised and the caller can handle it if wants to. However this error will appear regularly in the Nova logs under normal behavior (say a client specifies an image which does not exist) and there is no way of disabling only the glanceclient error log. This results in a lot of noise in the nova log file. Change-Id: Iec13bff439073a79cb24e9b22fd43603ae4e61b7
* | | Merge "Update how tokens are redacted"Jenkins2014-09-162-6/+15
|\ \ \
| * | | Update how tokens are redactedTravis Tripp2014-09-152-6/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Using SHA-1 to match how Nova and Swift redact their tokens. Was discussed in the below thread: http://lists.openstack.org/pipermail/openstack-dev/2014-September/045802.html Here's what nova went with: https://review.openstack.org/#/c/99511/ swift seem to be following suit: https://review.openstack.org/#/c/99632/ Change-Id: I3045d6d9d2a13770f4022dbbd474b34eb1032f6e Closes-bug: 1329301
* | | | Merge "Print traceback to stderr if --debug is set"Jenkins2014-09-161-0/+7
|\ \ \ \
| * | | | Print traceback to stderr if --debug is setLouis Taylor2014-09-151-0/+7
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change allows easier debugging of client related issues, with a full traceback printed out when an uncaught error occurs in the client. Previously, it could be hard to find the portion of code raising an exception, with just the message from the exception being displayed. Previous behaviour (with a rather artificial client error being raised): $ glance --debug image-list Contrived exception Behaviour after this patch: $ glance --debug image-list Traceback (most recent call last): File "/opt/stack/python-glanceclient/glanceclient/shell.py", line 590, in main args.func(client, args) File "/opt/stack/python-glanceclient/glanceclient/v1/shell.py", line 77, in do_image_list raise(Exception('Contrived exception')) Exception: Contrived exception Contrived exception Change-Id: Id7b76b707e5fc16a0402dcb104ec40787e0ffbe2
* | | | Handle UnicodeDecodeError in log_http_responseMatt Riedemann2014-09-152-1/+12
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | Similar to commit dec9c9f35 and log_curl_request, this ignores decoding errors when logging response headers by passing errors='ignore' to safe_encode. Change-Id: Ic915a7d8334e9473f300c9db670a3a8f5cda8976 Closes-Bug: #1369756
* | | Merge "Updated from global requirements"Jenkins2014-09-132-3/+9
|\ \ \
| * | | Updated from global requirementsOpenStack Proposal Bot2014-09-132-3/+9
| | | | | | | | | | | | | | | | Change-Id: I6dc3b647b806b863418d4894f9abe535b3d40ac2
* | | | Merge "Fix v2 requests to non-bleeding edge servers"Jenkins2014-09-1315-620/+727
|\ \ \ \ | |/ / / |/| | |
| * | | Fix v2 requests to non-bleeding edge serversLakshmi N Sampath2014-09-1215-620/+727
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the case where v2 requests are sent to a server which is not running head of tree which includes the v2 metadef code some 404 cases need to be handled to enable standard requests to complete. This patch aslo improves fetching schemas -- they are now only fetched as needed. Change-Id: I8c871f11b909337bd7df19b77e606772dbc634b2 Closes-bug: #1367326
* | | | Merge "Work toward Python 3.4 support and testing"Jenkins2014-09-131-1/+1
|\ \ \ \
| * | | | Work toward Python 3.4 support and testingJeremy Stanley2014-09-031-1/+1
| | | | | | | | | | | | | | | | | | | | Change-Id: I0498fcfdf9eee399e29de5b034fd6010682ca4b6
* | | | | Merge "Import missing gettextutils._ in shell.py"Jenkins2014-09-131-0/+1
|\ \ \ \ \ | |_|/ / / |/| | | |
| * | | | Import missing gettextutils._ in shell.pyMatthew Booth2014-09-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Closes-Bug: #1355252 Change-Id: I3aef19235735b3b374b92985f142712cb0f37a35
* | | | | Merge "Fix indentation in tox.ini"Jenkins2014-09-071-1/+1
|\ \ \ \ \
| * | | | | Fix indentation in tox.iniLouis Taylor2014-08-261-1/+1
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, a tab was used to indent a line with a block of code which otherwise uses eight spaces, causing it to display strangely in text editors which do not have tabstop=8 set. TrivialFix Change-Id: I99a432373beebac912df88e6685db26e738bf654
* | | | | Support for Metadata Definitions Catalog API0.14.0Pawel Koniszewski2014-09-0312-43/+2716
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | API calls and shell commands added in this patch: - CRUD for metadefs namespaces; - CRUD for metadefs objects; - CRUD for metadefs properites; - CRD for metadefs resource types and resource type associations. Change-Id: I6d15f749038e8fd24fc651f0b314df5be7c673ef Implements: blueprint metadata-schema-catalog-support Co-Authored-By: Facundo Maldonado <facundo.n.maldonado@intel.com> Co-Authored-By: Michal Dulko <michal.dulko@intel.com> Co-Authored-By: Lakshmi N Sampath <lakshmi.sampath@hp.com> Co-Authored-By: Pawel Koniszewski <pawel.koniszewski@intel.com>
* | | | | Catch new urllib3 exception: ProtocolErrorPawel Koniszewski2014-09-031-1/+5
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new version of requests (2.4.0) has updated underlying urllib3 to version 1.9. Unfortunately urllib3 introduced new exception ProtocolError. Because of that unit tests in glance are failing: ProtocolError: ('Connection aborted.', gaierror(-2, 'Name or service not known')) To solve this problem new urllib3 exception is caught in the same place that the old one was. Unfortunately both exception are still in use so I couldn't remove the old one. Change-Id: I55eef98e734c59b9b627f182768a633b2b701e43 Closes-Bug: #1364893
* | | | Fix error when logging http response with python 3Louis Taylor2014-08-261-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Python 3 changed the semantics of dict.items() [0], which now returns a iterable 'view' instead of a list of tuples. This has the repercussion that you can no longer check for membership of a key using: key in dict.items() This patch simply replaces that check with a test for the key existing in the dict itself, rather than the items. [0] http://legacy.python.org/dev/peps/pep-3106/ Closes-Bug: 1359880 Change-Id: I7c59b0432725b660c9fa7270cde2e07bf3ea77db
* | | Merge "Update theme for docs"Jenkins2014-08-212-2/+3
|\ \ \
| * | | Update theme for docsSteve Martinelli2014-07-242-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The current developer docs theme used is out of sync with the other openstack projects. This patch will update the docs to provide a more consistent look and feel when using developer docs Change-Id: I4a59f194bd0fc8c86c6d3c6b8cadb839a5158935
* | | | Merge "Add a tox job for generating docs"Jenkins2014-08-202-0/+5
|\ \ \ \ | |/ / /
| * | | Add a tox job for generating docsSteve Martinelli2014-07-242-0/+5
| |/ / | | | | | | | | | | | | | | | | | | Add a tox job to make it easier for developers to generate their own docs before submitting a patch. Change-Id: I1897407d0db901c61360a196b365b0661eb65b66
* | | Merge "Enable osprofiler interface in glanceclient shell"Jenkins2014-08-202-4/+40
|\ \ \
| * | | Enable osprofiler interface in glanceclient shellZhi Yan Liu2014-08-192-4/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To help end user uses profiling by glanceclient CLI directly, the change added '--profile <HMAC_KEY>' argument to the shell. This change also fixed a function regression, it was used to pass necessary trace info to glance server via http header: https://github.com/openstack/python-glanceclient/commit/dbb242b776908ca50ed8557ebfe7cfcd879366c8#diff-740dd7d9149f46fe4c01ef0ab7eb3bfbL196 In addition: 1. If client app want to enable profiling feature for glanceclient object, please see: http://paste.openstack.org/show/85722/ 2. Afer adding more trace point into Client object, as fundamental requirement of osprofiler, what we need to notice caller is providing correct messaging notifier in the context code. The relevant change for glance server is ready at: I45a19f5eb5304c2b78a9e12cbc0744941a807304 DocImpact Change-Id: If42b69b2695a5f88536ecbc2c1b3592d9dbd880a Signed-off-by: Zhi Yan Liu <lzy.dev@gmail.com>
* | | | Ensure server's SSL cert is validatedStuart McLaren2014-08-192-3/+12
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A bug was introduced which meant that the server SSL certificate was not being verified. Here we make sure that it is checked (unless the --insecure flag is used). Helps guard against man-in-the-middle attack. Change-Id: I08f30bf3906b6580c871729311343fa8eefda91b Closes-bug: #1357430
* | | Merge "Hide stderr noise in test output"Jenkins2014-08-181-8/+18
|\ \ \
| * | | Hide stderr noise in test outputLouis Taylor2014-08-181-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, some tests caused the usage options for glance to be printed out to stderr. This patch redirects the stderr output for those unnecessarily verbose test functions. Change-Id: I781d35a16a97c9c093cb17288ebd96d3e1a2e4e9 Closes-Bug: #1334655
* | | | Merge "Normalize glanceclient requested service url"Jenkins2014-08-181-3/+4
|\ \ \ \ | |/ / / |/| | |
| * | | Normalize glanceclient requested service urlZhi Yan Liu2014-08-071-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some proxy or gateway softwares, e.g. jumpgate [0], use url-pattern based approach to match which hanlding logic needs to be triggered for particular service calling when it received a http(s) call as a middleman. The change fixed an issue which caused glanceclient send out the request to a dis-normal url, which contains duplicated "/". The change removed a wrong and duplicated code snippet from curl logging function as well. [0] http://goo.gl/yt52X1 Change-Id: Ic8b3920e11d400771ead7f9c44b615f10b4a5cef Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
* | | | Remove deprecated commands from shellCindy Pallares2014-08-127-1258/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove all deprecated commands from the shell since they are no longer used and to keep the command line menu from looking cluttered. Closes-bug: #1314218 Change-Id: I66e82872988e3835e4f290f48dfc80538271426c
* | | | Merge "Add support for Keystone v3"Jenkins2014-08-073-162/+704
|\ \ \ \
| * | | | Add support for Keystone v3Bob Thyne2014-08-053-162/+704
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This enables glanceclient to authenticate using Keystone v3 API and includes the addition of several new CLI arguments. DocImpact Change-Id: I863ba08d312363dc1ce4fc7822fb21ef53df1a4f
* | | | | Fix glance-client to work with IPv6 controllersSudipta Biswas2014-08-061-1/+12
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the glance client can't operate on IPv6 address based openstack controller IPs. The reason for this is the absence of creation of a IPv6 socket in the glance client code (in https.py). The glance client is trying to create sockets from the AF_INET socket family but this will lead to errors when glance client makes a call on the IPv6 IP addresses. In order to fix this limitation, we ensure that if the hostname resolves to IPv6 or an explicit IPv6 address is used to configure the openstack controller - glance client shall be able to detect that and then create a AF_INET6 socket family. In all other cases a AF_INET socket is created. We default to IPv4 sockets in all other cases. Change-Id: I7d5a09675cd5dab2e39f0faeaa7c169291eedac6 Closes-bug: #1348030
* | | | Merge "Use immutable arg rather mutable arg"Jenkins2014-08-031-2/+4
|\ \ \ \ | |_|/ / |/| | |
| * | | Use immutable arg rather mutable argliuqing2014-07-031-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Passing mutable objects as default args is a known Python pitfall. We'd better avoid this. This commit changes mutable default args with None. Change-Id: I78323383c8b6a9a516a2a217303124870822418b
* | | | Don't stream non-binary requestsMatt Riedemann2014-07-161-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Setting stream=True with requests can lead to issues with not closing the connection so the urllib3 connection pool is not freed up, so only set stream=True if making a request with application/octet-stream content-type. See the body-content-workflow and keep-alive sections in the requests docs here for more information: http://docs.python-requests.org/en/latest/user/advanced/ Note that commit dbb242b changed the response body_iter code to potentially return a six.StringIO object rather than the old ResponseBodyIterator class and since the images client code is not converting the body_iter into a dict using json.loads, we have to do that directly in the _request method where the body_iter is constructed. Co-authored-by: Flavio Percoco <fpercoco@redhat.com> Change-Id: I86572b69c4511f933c9676108190271874346302 Partial-Bug: #1341777
* | | | Use a correctly formatted example location in helpStuart McLaren2014-07-161-2/+6
| | | | | | | | | | | | | | | | | | | | Change-Id: Iea1ebc13979a61d7bed397fb79e2b2a85f00c400 Closes-bug: 1342753
* | | | Replace old httpclient with requestsAmalaBasha2014-07-1022-1042/+723
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This review implements blueprint python-request and replaces the old http client implementation in favor of a new one based on python-requests. Major changes: * raw_request and json_request removed since everything is now being handled by the same method "_request" * New methods that match HTTP's methods were added: - get - put - post - head - patch - delete * Content-Type is now being "inferred" based on the data being sent: - if it is file-like object it chunks the request - if it is a python type not instance of basestring then it'll try to serialize it to json - Every other case will keep the incoming content-type and will send the data as is. * Glanceclient's HTTPSConnection implementation will be used if no-compression flag is set to True. Co-Author: Flavio Percoco<flaper87@gmail.com> Change-Id: I09f70eee3e2777f52ce040296015d41649c2586a
* | | | Enable F841ChangBo Guo(gcb)2014-07-098-48/+42
| |_|/ |/| | | | | | | | | | | | | | | | | F841 detects local variable is assigned to but never used. This commit fixes the violations and enables F841 in gate. Change-Id: Ic4dcac2733dfe334009327ac17aa3952cafaa63a
* | | Merge "Add profiling support to glanceclinet"Jenkins2014-07-081-0/+7
|\ \ \
| * | | Add profiling support to glanceclinetBoris Pavlovic2014-07-061-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To be able to create profiling traces for Glance, client should be able to send special HTTP header that contains trace info. This patch is as well important to be able to make cross project traces. (Typical case nova calls glance via python client, if profiler is initialized in nova, glance client will add extra header, that will be parsed by special osprofiler middleware in glance api) Don't worry no security issue here, trace information is signed by HMAC key that is setted in api-paste.ini. So only person that knows HMAC key is able to send proper header. Change-Id: Ib13084fbe9b33c2f3dee165f7d6c778546cce6ca
* | | | Resolving the performance issue for image listing of v2 APIZhi Yan Liu2014-07-081-5/+19
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | According to my diagnosis [1], currently v2 API client consumed a lot of CPU times by JSON schema validation on image model initialization stage for image listing case. Because each image entry will triggers one validation operation which spent most CPU clocks. (My test env has 1002 image entries now, so it's O(N) logic obviously). This fix changed the original logic, it doesn't validate each image entry but do it only on first image entry for each page. This approach is a trade-off, it balanced the data validity and performance. As comparison [3], under the fixed new logic, the execution time of image listing is about four times as fast as old logic. [1] Clock type: CPU Ordered by: totaltime, desc name ncall ttot ..nt/v2/images.py:34 Controller.list 1003 12.08480 ../warlock/core.py:30 image.__init__ 1002 11.91074 ..warlock/model.py:28 image.__init__ 1002 11.90463 ..arlock/model.py:130 image.validate 1002 11.73838 ..nschema/validators.py:388 validate 1002 11.73682 [2] name ncall ttot ..nt/v2/images.py:35 Controller.list 1003 1.100710 ..nceclient/v2/images.py:45 paginate 256.. 1.099965 ../warlock/core.py:30 image.__init__ 1002 0.944762 ..warlock/model.py:28 image.__init__ 1002 0.939725 ..arlock/model.py:130 image.validate 51 0.779653 ..nschema/validators.py:388 validate 51 0.779431 [3] $ time glance --os-image-api-version 2 image-list | grep 'test-' | wc -l 1000 real 0m16.606s user 0m10.629s sys 0m2.540s $ time glance --os-image-api-version 2 image-list | grep 'test-' | wc -l 1000 real 0m4.151s user 0m1.080s sys 0m0.092s Change-Id: Ia6598d3c06a5ff516277053c2b6fa5db744fe9cf Signed-off-by: Zhi Yan Liu <zhiyanl@cn.ibm.com>
* | | Add CONTRIBUTING.rstliuqing2014-07-011-0/+16
| | | | | | | | | | | | | | | | | | There is no CONTRIBUTING.rst file, so i add it. Change-Id: Icaafaf86c3b4314e2e20611e5e08956f1ea993ea
* | | Added release notes for 0.13.00.13.10.13.0Flavio Percoco2014-06-301-0/+9
| | | | | | | | | | | | Change-Id: I51374661a5ce58cd2a970a75893b1251ab6e176b
* | | Merge "Add wheels section to the setup.cfg"Jenkins2014-06-301-0/+3
|\ \ \
| * | | Add wheels section to the setup.cfgFlavio Percoco2014-06-301-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Glance client's setup.cfg was missing the wheels section. This commit adds it and makes the client's setup.cfg consistent with other clients. Change-Id: I16030c0379dae3c3c07bd73f09798c2160310811