summaryrefslogtreecommitdiff
path: root/glanceclient
Commit message (Collapse)AuthorAgeFilesLines
* Get endpoint if os_image_url is not setNiall Bunting2016-05-242-17/+87
| | | | | | | | | | If env['OS_IMAGE_URL'] is not set then None is returned. This is then used ignoring the endpoint_type, service_type and region_name. This patch will use those values if the endpoint is None. Change-Id: I76cc527b05d2be75d3dbc33123a0d71be97fe25c Closes-bug: #1579768 (cherry picked from commit a862196cfb7f7323b1864b4c1660c39850487a64)
* Fix "Codec can't encode characters"Darja Shakhray2016-05-232-20/+17
| | | | | | | | | | | | | | Headers were encoded in HTTPClient, but when glance client started to use SessionClient this functionality was lost. This commit replaces static method "encode_headers" from HTTPClient and makes it a common function, that SessionClient can use when converting image meta to headers. Change-Id: If9f8020220d2a0431b4241b38b9c83c09c0d75cb Closes-bug: #1574587 (cherry picked from commit 9329ef0bc40375cd9b115415e10baf89789f56f0)
* Merge "Fix missing of debug info after we use session" into stable/mitakaJenkins2016-05-112-0/+21
|\
| * Fix missing of debug info after we use sessionCao ShuFeng2016-04-262-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the introduce of this patch set[1], cli user can't get debug info even --debug is passed. With the patch set[1], the request action will be performed in keystoneclient.session.Session. However the default log level of keystoneclient module is WARNING, so user can't get debug info from keystoneclient.session.Session. This change set the root log level to DEBUG when --debug is passed. [1]: https://review.openstack.org/#/c/262220/ Change-Id: I0db0fd7ab07a0d61082b86829a671d8dbc0f2963 Closes-bug: 1551076 (cherry picked from commit 87c8c933bd9b79a2cf06f9f0bc02160b21e8920d)
* | Re-enable stacktracing when --debug is usedStuart McLaren2016-03-302-10/+25
|/ | | | | | | | | | | | | | | | | | | | | | Commit 1f89beb6098f4f6a8d8c2912392b273bc068b2e3 introduced the behaviour that a stacktrace is printed if an exception is encountered. This helped make the client more supportable: $ glance --debug image-list . . . File "glanceclient/common/http.py", line 337, in get_http_client xxx NameError: global name 'xxx' is not defined global name 'xxx' is not defined The behaviour was lost at some point. This patch re-enables it. Change-Id: I25fc8624797909d606590747f54b9cf649ade079 Closes-bug: 1563830 (cherry picked from commit ca0989c52376a1d499cd0cc176f60b7ff8257275)
* Merge "Test: use assert_has_calls() instead"2.0.0Jenkins2016-02-291-3/+6
|\
| * Test: use assert_has_calls() insteadChaozhe.Chen2016-02-241-3/+6
| | | | | | | | | | | | | | | | Some of the assertions in glanceclient test are sequential, we should better use assert_has_calls() instead of assert_any_call(). And assert_has_calls() provides more clear messages in case of failure. Change-Id: Ie45e7c56b1c859916a1f31636c639422f1ffef28
* | Merge "Handle 403 forbidden on download"Jenkins2016-02-294-2/+46
|\ \ | |/ |/|
| * Handle 403 forbidden on downloadStuart McLaren2016-02-244-2/+46
| | | | | | | | | | | | | | | | | | | | A download of a deactivated image may result in a 403. The cli should catch this error rather than stack trace. We also catch other unexpected http responses. Change-Id: If33fbc3a56cdb02b3ab32a6479a67fff20b4b1a9 Closes-bug: 1523612
* | Merge "Auto-generated squash commit"Jenkins2016-02-122-3/+3
|\ \
| * | Auto-generated squash commitFlavio Percoco2016-02-112-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix misspellings Upstream-Change-Id: Ie7ecbe4b33dd0e1ef94b0be85ec3af790cc6fcd7 Correct spelling mistake Change interable to iterable. Upstream-Change-Id: I468a87a3df9ed00ed82f1ba0d6abbbc6944cf613 Change-Id: I4de8426cd19ef0bc7c00fe57f8bc3303d0a4f8a4 Co-Authored-by: venkatamahesh <venkatamaheshkotha@gmail.com> Co-Authored-by: Irina <yuyuesh@cn.ibm.com>
* | | Merge "v2 - "readOnly" key should be used in schemas"Jenkins2016-02-087-33/+58
|\ \ \
| * | | v2 - "readOnly" key should be used in schemaszwei2016-02-047-33/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If it has a value of boolean true, this keyword indicates that the instance property SHOULD NOT be changed, and attempts by a user agent to modify the value of this property are expected to be rejected by a server. The value of this keyword MUST be a boolean. The default value is false. Further link for reference: http://json-schema.org/latest/json-schema-hypermedia.html#anchor15 Closes-Bug: #1521581 Depends-On: I279fba4099667d193609a31259057b897380d6f0 Change-Id: I96717506259c0d28500b8747369c47029b1dd9b6
* | | | Merge "Remove code needed for python2.5"Jenkins2016-02-051-6/+0
|\ \ \ \
| * | | | Remove code needed for python2.5kairat_kushaev2016-02-011-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | glance has a code specific for python2.5. We need to delete this code cause glanceclient doesn't support neither python2.5 or python2.6. Change-Id: I17e4905b6e02fcfff033a6cde03324e2a47bfce2
* | | | | Merge "Fix client initialization in shell tests"Jenkins2016-02-021-4/+6
|\ \ \ \ \
| * | | | | Fix client initialization in shell testskairat_kushaev2016-02-011-4/+6
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Shell tests initialized glanceclient with force_auth parameter but this parameter doesn't exist at all. The patch fixes this behavior and modifies client mocking to prevent from these errors in future. Change-Id: If4b469cf8da8105204a7f1f6e80ae19b86c7daee
* | | | | Fix warnings in glanceclient READMEkairat_kushaev2016-02-011-5/+10
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | README.rst file for functional tests and glanceclient itself raises some warnings when passing these docs through REST validator and build the doc: - Need additional empty line to provide correct indent in cloud.yaml example - Title should be with the same length as overline. The patch fixes these warnings. Change-Id: I2e2ef6f838ee639d1a88256b6e321181a62cc76b
* | | | Merge "Fixed TestHTTPSVerifyCert failure messages"Jenkins2016-02-012-5/+14
|\ \ \ \
| * | | | Fixed TestHTTPSVerifyCert failure messagesDavid Sariel2016-01-152-5/+14
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to the change in python versions greater then 2.7.8, messages that SSL certificate handling module is producing are different from the error messages produced in earlier versions of py27. Fixed how the following test cases of TestHTTPSVerifyCert class are handling erroneous SSL certification messages: - test_v2_requests_valid_cert_no_key - test_v2_requests_bad_cert - test_v2_requests_bad_ca Closes-Bug:1499355 Change-Id: I3b939292ba0042bced5cc91a26e2593450f9cafe
* | | | Merge "Use session when not specified token or endpoint"Jenkins2016-02-012-116/+94
|\ \ \ \
| * | | | Use session when not specified token or endpointDarja Shakhray2016-01-142-116/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When no token or endpoint, it creates a session and from there taken the necessary values. This commit proposes to transfer a session in such cases. This will avoid unnecessary actions and some of the problems. Change-Id: Idc874b6c01e915e52904604d59e8e0b460e71621 Partial-bug: #1519546
* | | | | Merge "Remove monkey-patching for getsockopt"Jenkins2016-01-231-5/+0
|\ \ \ \ \
| * | | | | Remove monkey-patching for getsockoptkairat_kushaev2016-01-151-5/+0
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not getsocketopts is presented in GreenSocket for Linux. See the bug for the info. So we don't need to patch it anymore. Closes-Bug: #1348269 Change-Id: Ie2211238656eddfb0af5f3ef84ab638f6248a10a
* | | | | Change metavar for location commands in V2kairat_kushaev2016-01-201-3/+3
| |_|/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently location-add, location-delete and location-update shows <ID> in help messages as metavar for image id. It may be not clear to the users so we need to change this to <IMAGE_ID>. Change-Id: I59c787e449fa34bc792de179993c55f59734b9fe Closes-Bug: #1535220
* | | | Merge "Add help the ability to sort images with multiple keys"Jenkins2016-01-181-1/+2
|\ \ \ \
| * | | | Add help the ability to sort images with multiple keysKATO Tomoyuki2016-01-041-1/+2
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Related Change: If79779a4c52c8dc5c4f39192d3d247335a76ba24 This help is also used for OpenStack Command-Line Interface Reference. Change-Id: Iadce779afebe4aa80026e46f169546aba9055477 Partial-Bug: #1432813
* | | | Enhance description of instance-uuid option for image-createkairat_kushaev2016-01-182-2/+8
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | Current description of instance-uuid may confuse users because they may think that instance-uuid can serve as basis for image but it just stores instance-uuid as image-metadata. So we need to enhance the description in glanceclient. Change-Id: I55829d106c9d25374df6538b3071104ee5f215f2 Closes-Bug: #1496822
* | | Merge "Remove location check from V2 client"Jenkins2016-01-152-19/+8
|\ \ \
| * | | Remove location check from V2 clientkairat_kushaev2016-01-152-19/+8
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Glance client has a custom check that generates exception if location has not been returned by image-get request. This check should on server side and it should be managed by policy rules when do location-add action. That also allows to increase possibility of migrating Heat to v2[1]. NOTE: After this patch, we'll raise a HTTPBadRequest from server side instead of HTTPConflict when a user adds a duplicate location. [1]: https://review.openstack.org/#/c/240450/ Co-Authored-By: wangxiyuan <wangxiyuan@huawei.com> Change-Id: I778ad2a97805b4d85eb0430c603c27a0a1c148e0 Closes-bug: #1493026
* | | Merge "Add docker to image_schema on glance v2 cli"Jenkins2016-01-143-3/+6
|\ \ \
| * | | Add docker to image_schema on glance v2 cliAtsushi SAKAI2015-12-253-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add docker to v2 image_schema Add docker to v2 unit tests This is related to following glance api extension. https://review.openstack.org/#/c/249282/ Co-Authored-By: Kairat Kushaev <kkushaev@mirantis.com> Closes-Bug: #1519402 Change-Id: Ia015f027788b49c1b0002fb3e3a93ac825854596
* | | | Merge "use keystoneclient exceptions instead of oslo-incubator code"Jenkins2016-01-121-1/+1
|\ \ \ \
| * | | | use keystoneclient exceptions instead of oslo-incubator codeSteve Martinelli2015-12-271-1/+1
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | depending on any oslo-incubator code from another project is dangerous. keystoneclient makes its exceptions public and it's not recommended to use any code from keystoneclient.openstack.common.apiclient since it's maintained by oslo-incubator. Change-Id: Ibfd9d364d3199fb485987edef06e1de916e57ee5
* | | | Skip schema validation on GET /v2/images/%sNicolas Simonds2016-01-122-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are server-generated, not user-generated, and schema validation should not be necessary. Rework a unit test that enforces this; bad data should be blocked at ingest, not blocked on reads. Co-authored-by: Stuart McLaren <stuart.mclaren@hp.com> Change-Id: Ib1926fec0e858b6eed43c7931a6d6c3a1708e70e Closes-Bug: 1501046
* | | | Change assertTrue(isinstance()) by optimal assertLiuNanke2016-01-061-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | assertTrue(isinstance(A, B)) or assertEqual(type(A), B) in tests should be replaced by assertIsInstance(A, B) provided by testtools. Change-Id: I7135d3b7fe15b16c17b7581e553ce5d289b58f43 Related-bug: #1268480
* | | Merge "Disable suggestion of v1 help for v2 commands"Jenkins2015-12-221-3/+14
|\ \ \
| * | | Disable suggestion of v1 help for v2 commandsNiallBunting2015-12-091-3/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the client suggests 'Run `glance --os-image-api-version 1 help` for v1 help' at the end of every help message. This is could be confusing for a v2 only command. Therefore this patch disables it if the command does not exist in v1, while keeping the message on the 'glance help' results. Change-Id: I967e9ba35afb8dc40524bd1d13284e684b435f81 Closes-Bug: 1520602
* | | | Fix image-download to stdout on Python 3.xAndy Botting2015-12-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Glance image-download to stdout fails on Python3 due to sys.stdout.write not allowing bytes to be written directly. A good description of the issue is listed at http://bugs.python.org/issue18512 Closes-Bug: #1528083 Change-Id: I2963914e2e0744410267b5735ff77939413916d4
* | | | Replace assertEqual(None, *) with assertIsNone in testsShuquan Huang2015-12-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace assertEqual(None, *) with assertIsNone in tests to have more clear messages in case of failure. Change-Id: I384fbe8722af07bcaa4e2610384446751a8072bf Closes-bug: #1280522
* | | | Remove broken try/except workaround for old requestsMonty Taylor2015-12-151-5/+1
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | Not only is this code broken on the requests we require on distro-provided requests, it's not needed anymore. Remove it. Closes-bug: 1526254 Change-Id: I47a07bf9910f118392785fc20e015f036a2e8a7c
* | | Fix the download error when the image locations are blankLong Quan Sha2015-12-073-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the image locations are blank, glance client will get a http response with no content, glance client should show user no data could be found, instead of processing the blank response body that will lead to exception. Glance client will also get a 204 response when an image is in a queued state (this is true for 'master' and liberty/kilo/juno based servers). Closes-Bug: #1472449 Co-Authored-by: Stuart McLaren <stuart.mclaren@hp.com> Change-Id: I5d3d02d6aa7c8dd054cd2933e15b4a26e91afea1
* | | Merge "Fix Resource.__eq__ mismatch semantics of object equal"Jenkins2015-12-042-4/+8
|\ \ \
| * | | Fix Resource.__eq__ mismatch semantics of object equalRui Chen2015-11-282-4/+8
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The __eq__ of apiclient.base.Resource will return True, if the two objects have same id, even if they have different other attributes value. The behavior is weird and don't match the semantics of object equal. The objects that have different value should be different objects. Fix this issue and add some test cases in this patch. Change-Id: I24ba39bf90d727116f256de46241746520efbfee Closes-Bug: #1499369
* | | Merge "Fix tests for image-create"Jenkins2015-12-031-14/+10
|\ \ \
| * | | Fix tests for image-createJake Yip2015-11-301-14/+10
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | image-create unit tests still checks for obsolete v1 params --location and --copy-from remove checking of these params Closes-bug: 1521044 Change-Id: I75ae1a200ab319b7fb818b4ccfe784af5ef8ff88
* | | Merge "Fix help for image-create"Jenkins2015-12-031-2/+2
|\ \ \ | |_|/ |/| |
| * | Fix help for image-createJake Yip2015-11-301-2/+2
| |/ | | | | | | | | | | | | | | | | | | The help for image-create states that --file 'Must be present if images are not passed to the client via stdin.' However, doing image-create without --file is a valid operation - it queues a file to be created. Change-Id: I8167c6a891fa2540c84e3b888031d90a34a9b5fc
* | Merge "Update set of wanted commands in read-only test"Jenkins2015-12-011-5/+9
|\ \ | |/ |/|
| * Update set of wanted commands in read-only testKyrylo Romanenko2015-11-271-5/+9
| | | | | | | | | | | | | | Nowadays Glance supports more subcommands. Closes-Bug: #1520585 Change-Id: Ic95c26df31dc3bfb4436969e728f7a1a7c50ff0c