summaryrefslogtreecommitdiff
path: root/glanceclient/tests/unit
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Add support for glance-download import method"4.1.0Zuul2022-08-303-14/+161
|\
| * Add support for glance-download import methodPranali Deore2022-08-303-14/+161
| | | | | | | | | | Implements: blueprint glance-download-import-support Change-Id: Ia2bfad82bccf9acb6103b21112e680c44e295d39
* | Bump default pagesizeErno Kuvaja2022-08-262-2/+2
|/ | | | | | | | | | | | Bumping default pagesize to 200. With the previous default value of 20 glanceclient was doing lots of extra requests and schema validations. Based on my tests no performance improvement was seen over the pagesize of 200. Change-Id: I6d740ca3a9b32bf5d064d3ea74273bb619b32ad4 Closes-Bug: #1987834
* Merge "glance help <subcommand>: Clearly specify which options are mandatory"Zuul2022-05-051-0/+11
|\
| * glance help <subcommand>: Clearly specify which options are mandatoryCyril Roelandt2021-12-141-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Earlier glance help <subcommand> was listing required arguments as optional arguments in help text. Added new argument group to list required argument properly. $ glance help stores-delete Example before this change: usage: glance stores-delete --store <STORE_ID> <IMAGE_ID> Delete image from specific store. Positional arguments: <IMAGE_ID> ID of image to update. Optional arguments: --store <STORE_ID> Store to delete image from. After this change: usage: glance stores-delete --store <STORE_ID> <IMAGE_ID> Delete image from specific store. Positional arguments: <IMAGE_ID> ID of image to update. Required arguments: --store <STORE_ID> Store to delete image from. Change-Id: I51ea4c43fa62164ed43e78d1ae0fb0cb2521fc83 Closes-Bug: #1933390
* | Add doc and test for verbose parameterwhoami-rajat2022-04-211-0/+6
| | | | | | | | | | | | | | | | | | | | We currently have support to show verbose output for image-list with the command ``glance --verbose image-list`` but there is no documentation about it. This patch adds the documentation and a test to run it via CLI. Closes-Bug: #1969565 Change-Id: Ic6db4f5ab2fecded373b044aa002f9a9bc262513
* | Add support for Cache APIErno Kuvaja2022-02-222-0/+311
| | | | | | | | | | | | | | This change provides support for the Cache API changes and deprecation path for glance-cache-manage command. Change-Id: I6fca9bbe6bc0bd9b14d8dba685405838131160af
* | Merge "Add an optional parameter --append"Zuul2022-02-171-2/+24
|\ \
| * | Add an optional parameter --appendMridula Joshi2022-02-161-2/+24
| |/ | | | | | | | | | | | | | | | | | | | | This patch will add an optional parameter --append to the glanceclient command md-tag-create-multiple to provide the facility of appending the tags. If the parameter is present it will append the tags to existing one, else it will overwrite the existing tags. Depends-On: https://review.opendev.org/c/openstack/glance/+/804966 Change-Id: I1841e7146da76b13f4cd8925e19f59d0eaf08f7a
* | Merge "Add an optional parameter --detail"Zuul2022-02-161-2/+50
|\ \
| * | Add an optional parameter --detailMridula Joshi2022-02-021-2/+50
| |/ | | | | | | | | | | | | | | | | This patch appends th --detail parameter to the ``stores-info`` command. With sufficient permissions, display additional information about the stores. Depends-On: https://review.opendev.org/c/openstack/glance/+/824438 Change-Id: I6ae08ab3eaab0c2b118aa7607246214b28025dfe
* | Add support for usage APIDan Smith2022-01-312-0/+47
|/ | | | | | | | This is really a very simple activity of fetching and showing the results of the usage API in table form for the user. Depends-On: https://review.opendev.org/c/openstack/glance/+/794860 Change-Id: I3d9360785a759e4a6e7905710400baea80776052
* Correct releasenote path for member-get commandRajat Dhasmana2021-09-221-5/+0
| | | | | | | | This patch moves the releasenote of member-get command to correct path. Closes-Bug: #1944798 Change-Id: Ifa76fc993b0ff47131401ba233e77001cd74107c
* Fix undesirable raw Python errorMridula Joshi2021-08-031-0/+8
| | | | | | | | | | | | | Using the glanceclient without a subcommand while passing an optional argument triggers the raw Python error `ERROR: 'Namespace' object has no attribute 'func'`. This bug can be reproduced by issuing the command `glance --os-image-api-version 2`. Added a default value to `func` as placeholder so that a help message is shown instead of the Python error. Closes-Bug: #1903727 Change-Id: Ie4288262e408192310cbbc240bd1779b265a64fd
* Add member-get commandMridula Joshi2021-08-023-0/+31
| | | | | | | | | It is observed that python-glanceclient was missing support for GET /v2/image/{image_id}/member/{member_id} API. This patch adds new command `member-get` to support this missing operation. Closes-Bug: #1938154 Change-Id: I3709f6a39535aa45bee70f468f015ac60a1375a8
* Get tasks associated with imageAbhishek Kekane2021-03-023-0/+89
| | | | | | | Add support to get tasks associated with specific image. bp: messages-api Change-Id: Ia505cf6f47ca6c628e195be3ca5231d22d53040d
* Update test certificates to use strong signingJames Page2020-08-073-145/+115
| | | | | | | | Modern OpenSSL (and specifically on Ubuntu) will reject certificates signed using the sha1 algorithm. Refresh test CA and associated certificates using sha256. Change-Id: Ie22a4630eb0f5993a909efed27088321c1865ca8
* Fixes "stores" property added to the image3.2.1Erno Kuvaja2020-07-301-0/+50
| | | | | | | | "stores" property gets added to the image when `glance image-create-via-import` is called with --stores Change-Id: I514e6e3ac2f3a1f56fb7883ed403a04b1e7f13b0 Closes-Bug: #1889666
* Merge "Do not use the six library."Zuul2020-07-171-21/+0
|\
| * Do not use the six library.Cyril Roelandt2020-06-231-21/+0
| | | | | | | | Change-Id: I3dbfcfa0f5f590a41ed549afd44537d8ed41433a
* | Merge "Do not use the six library in the tests."Zuul2020-07-168-93/+64
|\ \ | |/
| * Do not use the six library in the tests.Cyril Roelandt2020-06-158-93/+64
| | | | | | | | Change-Id: Ic8a2a736a733e0151ca82f19bfde428dc04cf255
* | Pass Global Request ID on with session clientErno Kuvaja2020-07-131-0/+14
|/ | | | | Closes-bug: #1886650 Change-Id: I3a08c1beb398ba9f2556b6779c925f679bdc2c49
* Fail gracefully when MD5 is unavailableBrian Rosmaita2020-05-041-0/+18
| | | | | | | | | The glanceclient currently assumes that MD5 will always be available. This is not the case, however, in a FIPS-compliant environment. This patch enables the glanceclient to fail gracefully in such a case. Closes-bug: #1871675 Change-Id: Ibd89989e06cc5be7da71f5f21561d73b5abc4104
* Use unittest.mock instead of third party mockSean McGinnis2020-04-188-8/+10
| | | | | | | | Now that we no longer support py27, we can use the standard library unittest.mock module instead of the third party mock lib. Change-Id: I446ee142c7a17446372c910f7f2a36d55df18e04 Signed-off-by: Sean McGinnis <sean.mcginnis@gmail.com>
* Update hacking for Python3Andreas Jaeger2020-04-024-5/+9
| | | | | | | | | | | | The repo is Python 3 now, so update hacking to version 3.0 which supports Python 3. Fix problems found. Remove hacking and friends from lower-constraints, they are not needed for installation. Change-Id: I5ae47a7b11ff29a301e440c15daf30db7738485b
* Delete image from specific storeErno Kuvaja2020-03-201-0/+23
| | | | | | | Add support to delete image from specific store. bp: delete-from-store Change-Id: Ie57d7de5822264a5ea8a5f4587ab8cfb4afb79de
* Add support for copy-image import method3.0.0Abhishek Kekane2020-02-271-1/+98
| | | | | | | | This change adds support for copy-image import method which will copy existing images into multiple stores. Change-Id: I748a8fb3dbaf9c2e4d887a2ecd4325e27a8429c4 bp: copy-image-multiple-stores
* Add support for multi-store importErno Kuvaja2020-02-271-3/+167
| | | | | | | | | | | This change adds support for providing multiple target stores where image can be imported. Co-authored-by: Erno Kuvaja <jokke@usr.fi> Co-authored-by: Abhishek Kekane <akekane@redhat.com> bp: import-multi-stores Change-Id: I8730364263f1afd5d11fd56939851bda73a892bb
* Merge "Rename --backend to --store"2.17.0Zuul2019-09-131-22/+22
|\
| * Rename --backend to --storeAbhishek Kekane2019-05-141-22/+22
| | | | | | | | | | | | | | | | As a part of vocabulary correction renamed --backend parameter to --store. Modfied corresponding tests as well. bp:multi-store-vocabulary-correction Change-Id: I3dc115f5f0f3c4edcca0209e139aa3d1d816357c
* | Update hacking versionjacky062019-03-272-5/+5
|/ | | | | | Use latest release 1.1.0 and compatible changes w.r.t pep8 Change-Id: Ifc3b96d98c1a7feff187f953d487e12135887fb9
* Merge "Embed validation data when adding location"Zuul2019-03-071-8/+15
|\
| * Embed validation data when adding locationimacdonn2018-10-241-8/+15
| | | | | | | | | | | | | | | | Add support for embedding of checksum, os_hash_algo and os_hash_value when adding a location to an image. Depends-On: https://review.openstack.org/597648 Change-Id: Ibbe2f2bb226f52cc6b2ab591913b1797d2b086c0
* | Add image-list filter for multihashBrian Rosmaita2019-01-172-0/+68
| | | | | | | | | | | | | | | | | | | | | | This was missed when multihash support was added to the glanceclient. The os_hash_value is an indexed field in the API. Includes a release note. Closes-bug: #1788271 Change-Id: Ibfe28b8c644967b7e0295dfd3f55c3ae1b0cbb2d
* | Merge "Show the backend store info"2.15.0Zuul2018-11-151-0/+82
|\ \
| * | Show the backend store infoLiang Fang2018-11-081-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When running "glance -v image-list" there's no store info listed, so user cannot know the type of the backend. This patch added an new option "--include-stores" and is to add the store id to the output of "glance image-list --include-stores". The final output may like: +-----+------+-------------+-----+----------+--------+-----+------+ | ID | Name | Disk_format | ... | Size | Status |Owner|Stores| +-----+------+-------------+-----+----------+--------+-----+------+ | xxx | img1 | raw | ... | 10737418 | active | xxx | ceph | | xxx | img2 | raw | ... | 5086345 | active | xxx | file | +-----+------+-------------+-----+----------+--------+-----+------+ Change-Id: If86ef714c3aa03ce43ef29f26892f431f4766560 Co-authored-by: Jack Ding <jack.ding@windriver.com> Signed-off-by: Liang Fang <liang.a.fang@intel.com>
* | | Don't quote colon in HTTP headersimacdonn2018-11-011-1/+7
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the introduction of quoting of header content in https://review.openstack.org/568698, the 'x-image-meta-location' header has been broken, because urllib.quote() is really intended to be applied to only the path section of a URL, but in this case, it gets applied to the entire URL, and catches the colon that separates the scheme from the remainder of the URL. This change adds the colon to the list of characters that should not get quoted. Since a colon can be directly represented in ASCII, this should not invalidate the previous change. Change-Id: I76a1c9a361b6c9f6eb95ae766b8c3bcf2267703a Closes-Bug: #1788942
* | Use "multihash" for data download validationBrian Rosmaita2018-09-074-17/+263
|/ | | | | | | | | | | | When the Glance "multihash" is available on an image, the glanceclient should use it instead of MD5 to validate data downloads. For cases in which the multihash specifies an algorithm not available to the client, an option is added to the image-download command that will allow fallback to the legacy MD5 checksum verification. Change-Id: I4ee6e5071eca08d3bbedceda2acc170e7ed21a6b Closes-bug: #1788323
* Skip quote '=' for token headerwangxiyuan2018-07-261-3/+4
| | | | | | | | | | If the token is encoded by base64, it may contain '=' char as well. We should skip quoting it. Change-Id: I1ca63d251fa366f0e8e58128d45b729a2489b65c Partial-Bug: #1783290
* Merge "Do not quote '+' for token header"Zuul2018-07-251-3/+3
|\
| * Do not quote '+' for token headerwangxiyuan2018-07-251-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The token in request header may contain url char, such as '+', if quote it, '+' will change to '%2B' which will lead to 401 error. Our CI doesn't notice this bug because Keystone use fernet token which doesn't contain url char by default. But token format in keystone is plugable, some out-tree token formats may contain url char (for example, PKI/PKIZ token). So we should skip quote token to avoiding information changing. Closes-bug: #1783290 Change-Id: I5aa71b3e2b9b19581e46ccf8a80eda5d637f17d1
* | Add support for hide old imagesAbhishek Kekane2018-07-251-8/+123
|/ | | | | | | | Added --hidden argument to list, create and update call. Related to blueprint hidden-images Change-Id: I1f2dcaa545c9da883186b20a96a70c7df994b994
* Merge "Unit tests for multi-store support"Zuul2018-07-251-0/+232
|\
| * Unit tests for multi-store supportAbhishek Kekane2018-07-241-0/+232
| | | | | | | | | | | | Related to blueprint multi-store Change-Id: Ib22cc5fd4eee0326c307abb236ef31a39edfa6a6
* | Merge "Add multi-store support"Zuul2018-07-251-4/+6
|\ \ | |/
| * Add multi-store supportAbhishek Kekane2018-07-241-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | Added multi-store support. User can now use '--backend' option to pass desired store while creating, uploading or importing image to speific store backend. Added new command 'stores-info' which will return available stores information to the user. Related to blueprint multi-store Change-Id: I7370094fc4ed47205b5a86a18b22aaa7b9457e5b
* | Add support for multihashAbhishek Kekane2018-07-231-0/+76
|/ | | | | | Related to blueprint multihash Change-Id: Iff4a5fe224b5d47255d7f23f65bbc08468f47f02
* update shell tests to not rely on the serialization order of a dictDoug Hellmann2018-06-071-8/+8
| | | | | | | | | Under python 3 with ordering randomized we cannot depend on the JSON output matching exactly. Instead we de-serialize the data structure that was written and compare the structures, which will always match. Change-Id: I134b62413a7cde25f3efda6a2452c1e3d11d41d0 Signed-off-by: Doug Hellmann <doug@doughellmann.com>
* Image show: print human readable string when the virtual size is unknownCyril Roelandt2018-05-311-0/+38
| | | | | | | | | Currently, when the virtual size of an image is not known, "None" is displayed. To a regular user, it feels like a programming error. We try and make things clearer by using a "human readable" string instead. Change-Id: Id7b8799356857d9bc58cc8a3677024fe1a7f4f56 Partial-Bug: #1665037