summaryrefslogtreecommitdiff
path: root/tests
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Don't replace the https handler in the poolmanager"0.14.2Jenkins2014-11-051-1/+11
|\
| * Don't replace the https handler in the poolmanagerFlavio Percoco2014-10-301-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to keep the support for `--ssl-nocompression` it was decided to overwrite the https HTTPAdapter in `requests` poolmanager. Although this seemed to work correctly, it was causing some issues when using glanceclient from other services that rely on requests and that were also configured to use TLS. THis patch changes implements a different strategy by using `glance+https` as the scheme to use when `no-compression` is requested. Closes-bug: #1350251 Closes-bug: #1347150 Closes-bug: #1362766 Change-Id: Ib25237ba821ee20a561a163b79402d1375ebed0b
* | Merge "Adds support for Glance Tasks calls"Jenkins2014-10-161-0/+282
|\ \
| * | Adds support for Glance Tasks callsFei Long Wang2014-09-221-0/+282
| |/ | | | | | | | | | | | | | | | | | | Add tasks operations on client side to support task create, list all and show. DocImpact Implement blueprint async-glance-workers Change-Id: Ib4b8e347a8a47817e3b427c8ba024e8c32f65155
* | Merge "Skip non-base properties in patch method"Jenkins2014-10-032-1/+62
|\ \
| * | Skip non-base properties in patch methodKamil Rykowski2014-09-292-1/+62
| |/ | | | | | | | | | | | | | | | | | | It's currently impossible to update properties which are defined in image schema and which are not a base image property. Proposed fix skips every non-base property when building a json patch, that is used to update image properties through glance API. Change-Id: I3b35cef379fcf437715e2966f9a0d25c1b4e4016 Closes-Bug: #1371559
* | Fix the ordering of assertEqual argumentsLouis Taylor2014-09-193-17/+17
|/ | | | | | | | This keeps testtools happy, since it expects the argument ordering to be (expected, actual). Change-Id: I95b41ad7645700ce23b46c7a5700e79008ed08be Closes-bug: #1277104
* Handle UnicodeDecodeError in log_http_responseMatt Riedemann2014-09-151-0/+10
| | | | | | | | | 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
* Fix v2 requests to non-bleeding edge serversLakshmi N Sampath2014-09-129-566/+638
| | | | | | | | | | | | 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
* Support for Metadata Definitions Catalog API0.14.0Pawel Koniszewski2014-09-037-25/+1927
| | | | | | | | | | | | | | | 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>
* 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
* Remove deprecated commands from shellCindy Pallares2014-08-124-655/+0
| | | | | | | | | | 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-072-10/+395
|\
| * Add support for Keystone v3Bob Thyne2014-08-052-10/+395
| | | | | | | | | | | | | | | | | | This enables glanceclient to authenticate using Keystone v3 API and includes the addition of several new CLI arguments. DocImpact Change-Id: I863ba08d312363dc1ce4fc7822fb21ef53df1a4f
* | Replace old httpclient with requestsAmalaBasha2014-07-1010-498/+265
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-095-44/+39
| | | | | | | | | | | | | | F841 detects local variable is assigned to but never used. This commit fixes the violations and enables F841 in gate. Change-Id: Ic4dcac2733dfe334009327ac17aa3952cafaa63a
* | Merge "Fix CA certificate handling"Jenkins2014-06-301-0/+21
|\ \
| * | Fix CA certificate handlingStuart McLaren2014-06-251-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If --os-cacert was passed to the cli the following error was triggered: "cafile must be None or a byte string". This is because 'load_verify_locations' requires a byte string to be passed in. We fix this by explicitly converting the argument to a byte string. We do this in 'VerifiedHTTPSConnection' rather than sooner, eg during arg handling, as it will no longer be required should we move to a different http library (eg requests). Fixes bug 1301849. Change-Id: I9014f5d040cae9f0b6f03d8f13de8419597560cb
* | | Merge "Set purge-props header correctly in image update"Jenkins2014-06-241-2/+13
|\ \ \
| * | | Set purge-props header correctly in image updateMaithem2014-06-191-2/+13
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | Currently when an image is updated, the purge property header is only set to true in some cases, but when required it isn't set to false Change-Id: I885a82643d2620f393f21c36b3ad95cb7ed43f2c Closes-Bug: 1318079
* | | Merge "Prepend '/' to the delete url for the v2 client"Jenkins2014-06-241-2/+2
|\ \ \
| * | | Prepend '/' to the delete url for the v2 clientManuel Desbonnet2014-06-231-2/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and update tests to match. The missing slash results in a non-absolute DELETE request being sent to the API. E.g. DELETE v2/images/62fac489-23b4-4929-87af-2e7236e8542b HTTP/1.1 This is not strictly valid http/1.1 - rfc2616 specifies that the path must be absolute. This doesn't cause a problem for the API server, but this can cause problems if the API server is fronted by something else (see #133161). It also means that the curl command logged in debug mode has a bad url. E.g. curl -i -X DELETE ... http://10.0.0.13:9292v2/images/... Change-Id: Ib0c749dedbfcf07303fcddae4512db61b0f3fd78 Closes-bug: #1327101
* | | Merge "Change assertTrue(isinstance()) by optimal assert"Jenkins2014-06-241-1/+1
|\ \ \ | |/ / |/| |
| * | Change assertTrue(isinstance()) by optimal assertwanghong2014-03-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | assertTrue(isinstance(A, B)) or assertEqual(type(A), B) in tests should be replaced by assertIsInstance(A, B) provided by testtools. I have searched all the tests, there is only one wrong usage. Change-Id: Ib1db1a2dca7b5d8cbfe823973e4b571d0f0925c5 Closes-bug: #1268480
* | | Merge "Reuse class Manager from common code"Jenkins2014-06-183-1/+32
|\ \ \
| * | | Reuse class Manager from common codeAndrey Kurilin2014-06-123-1/+32
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Class `Managers` from `glanceclient.common.base` module is similar to class `apiclient:ManagerWithFind` from common code. In this patch: - class glanceclient.common.base:Managers replaced by apiclient:ManagerWithFind - module glanceclient.common.base marked as 'deprecated' Related to bp common-client-library-2 Change-Id: I41da4a9188e97ca2c07b6234fc2ac0a877553d3f
* | | Change a debug line to prevent UnicodeDecodeError issueMichael Still2014-06-181-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This debug line is causing tracebacks in the n-cpu logs for tempest runs. Its because the logged data is sometimes unicode: Traceback (most recent call last): File "/usr/lib/python2.7/logging/__init__.py", line 846, in emit msg = self.format(record) File "/opt/stack/new/nova/nova/openstack/common/log.py", line 710, in format return logging.StreamHandler.format(self, record) File "/usr/lib/python2.7/logging/__init__.py", line 723, in format return fmt.format(record) File "/opt/stack/new/nova/nova/openstack/common/log.py", line 674, in format return logging.Formatter.format(self, record) File "/usr/lib/python2.7/logging/__init__.py", line 467, in format s = self._fmt % record.__dict__ UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 1234: ordinal not in range(128) Logged from file http.py, line 153 The change used correct encoding error handling policy for the log which may includes non-ascii char. Closes-bug: 1320655 Change-Id: I97f5f14b9beddcceb7fbd371062caf5a38a62a20
* | | Merge "Add support for location parameters in v2 commands"Jenkins2014-06-172-17/+206
|\ \ \
| * | | Add support for location parameters in v2 commandsDavid Koo2014-06-162-17/+206
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently glanceclient's v2 commands don't support modification operations on an image's location attribute - the argparse specification for the location attribute of the image-update command causes the image id argument to be included in list of locations and so the command parsing fails (because it causes the image id to appear to be missing). Furthermore even if the 'locations' argument were to be accepted by argparse (e.g. by changing the argument specs and using --id to specify the image id) the command would still fail because the arguments are passed directly to the schema which expects the value of the 'locations' argument to be a valid dictionary (there is nobody to convert the argument string to a python dictionary that the schema expects). This commit adds the following location related commands to glanceclient: --location-add: Add a new location to the list of image locations. --location-delete: Remove an existing location from the list of image locations. --location-update: Update the metadata of existing location. The glanceclient.v2.images.Controller class has been agumented with three new methods to support the commands listed above: - add_location - delete_locations - update_location The server has not been modified, i.e. all location related API requests are passed to the server via HTTP PATCH requests and handled by the server's image update function. The v2 'image' and 'shell' related tests have also been supplemented. Note that in order to use these options the server must be first configured to expose location related info to the clients (i.e. 'show_multiple_locations' must be set to 'True"). I also added a mailmap entry for myself. DocImpact Closes-bug: #1271452 Co-Author: David Koo (koofoss) <david.koo@huawei.com> Change-Id: Id1f320af05d9344645836359758e4aa227aafc69
* | | Merge "progress flag not supported in v2 API"Jenkins2014-06-171-1/+14
|\ \ \
| * | | progress flag not supported in v2 APIwanghong2014-04-161-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently only download method supports --progress flag in v2 API. This patch let upload method in v2 API support this flag too. Change-Id: I1d22379c320adb47a2178697e546413b9257f987 Closes-Bug: #1286265
* | | | Convert passed integer values into int in v1 shellCindy Pallares2014-06-121-3/+43
| |/ / |/| | | | | | | | | | | | | | | | | Add the type to the parameters that require an integer in the V1 shell to avoid sending an improper request. Change-Id: Idb1ed39b11ca737fdd42d24e297c142f28dce35c
* | | Python 3: use next(foo) instead of foo.next()Cyril Roelandt2014-06-021-1/+1
| | | | | | | | | | | | | | | | | | This is compatible with both versions of Python. Change-Id: I50f9b2fa0c2333010c10eb4db34d972aa379f0e3
* | | Merge "Finalize Python3 support"Jenkins2014-05-285-21/+37
|\ \ \
| * | | Finalize Python3 supportFrederic Lepied2014-05-205-21/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Set the environment variable PYTHONHASHSEED to 0 to have predictive tests under Python 3. Change-Id: Ia15a9383e0f20bd0e4572e9f9b9772f1704dff86
* | | | Merge "Return request ID to callers"Jenkins2014-05-201-1/+126
|\ \ \ \ | |/ / / |/| | |
| * | | Return request ID to callersChris Buccella2014-04-251-1/+126
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, calls (create, get, etc.) return only the Image to a caller. In order to log a mapping the request IDs of both glanceclient and the caller, the x-openstack-request-id header value is needed on the server side. This change allows that value to be bubbled up and returned to the caller so that the appropriate logging can occur. The return_req_id parameter can be set by services that are logging request IDs. Glance's request ID will then be returned via the return_req_id parameter. This is a prerequisite for Log Request ID Mappings nova-spec to be completed; Change Ib9b820a0feeb0c0e828ed3e4fab8261f8761ba9a Change I43be05c351f901cee5509c76cff6d69f060c0b3f is an example of a caller using this. Implements: blueprint return-req-id Change-Id: Ia82aa14db5f0e453010514fffb9a25d7b0fc2fd1
* | | Merge "Fix the parameter order of assertEqual in glanceclient v2 test"Jenkins2014-04-235-74/+75
|\ \ \
| * | | Fix the parameter order of assertEqual in glanceclient v2 testEiichi Aikawa2014-02-275-74/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On assertEqual, the order of parameters should be (expected, observed). But, some part of glanceclient v2 test were written with invalid order. This patch fixes this problem. Partially Close-bug: #1277104 Change-Id: Iae3fb9dda28b67a07f527b15ca83d9cca3e867d4
* | | | Merge "Fix the parameter order of assertEqual in glanceclient test"Jenkins2014-04-215-47/+49
|\ \ \ \
| * | | | Fix the parameter order of assertEqual in glanceclient testEiichi Aikawa2014-02-255-47/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On assertEqual, the order of parameters should be (expected, observed). But, some part of glanceclient test were written with invalid order. This patch fixes this problem. Change-Id: I7722fdce766ce3cc5bc9944dc72d7d0af0b09f69 Partially-bug: #1277104
* | | | | Merge "Fix for invalid literal ValueError parsing ipv6 url(s)"Jenkins2014-04-171-2/+2
|\ \ \ \ \ | |_|_|/ / |/| | | |
| * | | | Fix for invalid literal ValueError parsing ipv6 url(s)Davanum Srinivas2014-04-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Switch to using network_utils for splitting the URL. The code in oslo-incubator supports ipv6 urls Change-Id: I76be6173b97eb000319d30b4e9232a5a7c4a5aba Closes-Bug: #1298137
* | | | | Fix the parameter order of assertEqual in glanceclient v1 testEiichi Aikawa2014-03-174-130/+130
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On assertEqual, the order of parameters should be (expected, observed). But, some part of glanceclient v1 test were written with invalid order. This patch fixes this problem. Change-Id: If361309041a257c56bfc1fbbccf1b905839b0c18 Partially-bug: #1277104
* | | | Merge "Python 3: do not use __builtin__"Jenkins2014-03-081-3/+3
|\ \ \ \
| * | | | Python 3: do not use __builtin__Cyril Roelandt2014-03-071-3/+3
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | Use six.moves.builtins instead, this works with both Python 2 and 3. Change-Id: I17cdf651edbf7907e2b8b3d6aec9ace8a76b0110 Closes-Bug: 1289107
* | | | Merge "Python3: do not use the 'file' type"Jenkins2014-03-081-2/+9
|\ \ \ \ | |/ / / |/| | |
| * | | Python3: do not use the 'file' typeCyril Roelandt2014-03-041-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | It does not exist in Python 3, so we have to use a workaround. Change-Id: Ib41b5d12102707004b354835265861710aaba568 Closes-Bug: 1287728
* | | | Merge "test_shell: remove a deprecated keyword argument"Jenkins2014-03-041-1/+0
|\ \ \ \ | |/ / / |/| | |
| * | | test_shell: remove a deprecated keyword argumentCyril Roelandt2014-02-191-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The 'version' keyword argument of argparse.ArgumentParser is deprecated. It was set to 'None' anyway, so just remove it. Closes-Bug: #1281856 Change-Id: I6e5af0d90e9b1e7a6a60d5183c13299101148442