summaryrefslogtreecommitdiff
path: root/glanceclient
Commit message (Collapse)AuthorAgeFilesLines
* do_image_import: fix argument retrievalCyril Roelandt2023-04-182-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | The argparse module automatically replaces '-' characters with '_' characters when converting an option string to an attribute: «For optional argument actions, the value of dest is normally inferred from the option strings. ArgumentParser generates the value of dest by taking the first long option string and stripping away the initial -- string. If no long option strings were supplied, dest will be derived from the first short option string by stripping the initial - character. Any internal - characters will be converted to _ characters to make sure the string is a valid attribute name.»[1] This means that the value of the "--remote-region" option of the "image-import" command will be available as "args.remote_region"; "remote-region" would not be a valid attribute anyway. We make sure to retrieve the proper value for the following options: --remote-region, --remote-image-id and --remote-service-interface. [1] https://docs.python.org/3/library/argparse.html#dest Change-Id: I1d8c69acd5d61fdc426469cd87d1ace81871e60f Partial-Bug: #2012442
* Merge "Unhardcode the value of DEFAULT_PAGE_SIZE from the tests"Zuul2023-02-094-23/+34
|\
| * Unhardcode the value of DEFAULT_PAGE_SIZE from the testsCyril Roelandt2022-11-144-23/+34
| | | | | | | | | | | | | | | | | | | | The value of DEFAULT_PAGE_SIZE (20) was hardcoded in multiple places in the tests, which means all the tests would break should we ever want to change that value. Co-Authored-By: 韩春蕾 <1922361860@qq.com> Change-Id: I6e8dbae32c3a24d3fbeebcea5bfe0dd9ae247035
* | Merge "Remove unicode-related Python2-only code"Zuul2023-01-126-49/+20
|\ \
| * | Remove unicode-related Python2-only codeCyril Roelandt2022-11-146-49/+20
| | | | | | | | | | | | | | | | | | | | | | | | This commit: - removes the old "u" prefix from all strings - removes the unicode_key_value_to_string function Change-Id: I1da347e31e828fd2359f0935a4da47257116d4cb
* | | Merge "Boolean options: use strict checking"Zuul2023-01-122-1/+9
|\ \ \
| * | | Boolean options: use strict checkingCyril Roelandt2022-11-142-1/+9
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Boolean options (such as "--protected" for glance md-namespace-update) should accept a limited amount of valid values, rather than assuming an "invalid" value means "False". The following values (no matter the case) will now be interpreted as True: ‘t’,’true’, ‘on’, ‘y’, ‘yes’, or ‘1’. The following values (no matter the case) will now be interpreted as False: ‘f’, ‘false’, ‘off’, ‘n’, ‘no’, or ‘0’. Change-Id: I0e7942045d883ac398bab4a7a85f2b4ac9b1ed8c Closes-Bug: #1607317
* | | Fix functional tests and docs generationCyril Roelandt2023-01-122-2/+16
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First, fix test_help(). A commit[1], which first appeared in Python 3.10, changes the output of the help feature of argparse. Options used to be in a section named "Optional arguments:", and they are now in a section named "Options:". Second, tox 4 changes the behaviour of tox, and {toxinidir}/requirements.txt is no longer installed automagically in the docs virtual environment. This causes autodoc to fail on some imports. We explicitely add {toxinidir}/requirements.txt to the list of dependencies to fix this issue. These issues should be fixed in separate patches, but since they both block the CI, they depend on each other. [1] https://github.com/python/cpython/pull/23858 Change-Id: Ia7866390b31f469bdea95624325a13aaf45a496e Closes-Bug: #2002566
* | schema_args: Do not generate option for read-only propertiesCyril Roelandt2022-09-263-19/+15
|/ | | | | | | | | | The schema_args decorator generates command line options based on the properties defined in a schema. This commit makes sure read-only properties are skipped during this process, since trying to modify their value would result in a Glance error. Closes-Bug: #1561828 Change-Id: I7ccc628a23c9ebdaeedcb9e6d43559f497ce9555
* Merge "Add support for glance-download import method"4.1.0Zuul2022-08-305-20/+227
|\
| * Add support for glance-download import methodPranali Deore2022-08-305-20/+227
| | | | | | | | | | Implements: blueprint glance-download-import-support Change-Id: Ia2bfad82bccf9acb6103b21112e680c44e295d39
* | Bump default pagesizeErno Kuvaja2022-08-263-3/+3
|/ | | | | | | | | | | | 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
* Check if stdin has isatty attributeBenedikt Loeffler2022-07-072-3/+3
| | | | | | | When the stdin is closed, it has no isatty atrribute which leads to a KeyError. Closes-Bug: #1980890 Change-Id: If9a3bf68b8dfd953b346697241166578d18bb563
* Merge "glance help <subcommand>: Clearly specify which options are mandatory"Zuul2022-05-052-1/+16
|\
| * glance help <subcommand>: Clearly specify which options are mandatoryCyril Roelandt2021-12-142-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-226-1/+491
| | | | | | | | | | | | | | 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-173-8/+35
|\ \
| * | Add an optional parameter --appendMridula Joshi2022-02-163-8/+35
| |/ | | | | | | | | | | | | | | | | | | | | 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-163-4/+63
|\ \
| * | Add an optional parameter --detailMridula Joshi2022-02-023-4/+63
| |/ | | | | | | | | | | | | | | | | 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-315-0/+82
|/ | | | | | | | 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-032-0/+10
| | | | | | | | | | | | | 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-025-1/+46
| | | | | | | | | 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-026-0/+154
| | | | | | | 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-302-0/+53
| | | | | | | | "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-1714-144/+56
|\
| * Do not use the six library.Cyril Roelandt2020-06-2314-144/+56
| | | | | | | | Change-Id: I3dbfcfa0f5f590a41ed549afd44537d8ed41433a
* | Merge "Do not use the six library in the tests."Zuul2020-07-169-105/+76
|\ \ | |/
| * Do not use the six library in the tests.Cyril Roelandt2020-06-159-105/+76
| | | | | | | | Change-Id: Ic8a2a736a733e0151ca82f19bfde428dc04cf255
* | Merge "Pass Global Request ID on with session client"Zuul2020-07-162-1/+14
|\ \
| * | Pass Global Request ID on with session clientErno Kuvaja2020-07-132-1/+14
| |/ | | | | | | | | Closes-bug: #1886650 Change-Id: I3a08c1beb398ba9f2556b6779c925f679bdc2c49
* | Stop to use the __future__ module.Hervé Beraud2020-06-023-6/+0
|/ | | | | | | | | | | | | | | | | | | | | | | | | | The __future__ module [1] was used in this context to ensure compatibility between python 2 and python 3. We previously dropped the support of python 2.7 [2] and now we only support python 3 so we don't need to continue to use this module and the imports listed below. Imports commonly used and their related PEPs: - `division` is related to PEP 238 [3] - `print_function` is related to PEP 3105 [4] - `unicode_literals` is related to PEP 3112 [5] - `with_statement` is related to PEP 343 [6] - `absolute_import` is related to PEP 328 [7] [1] https://docs.python.org/3/library/__future__.html [2] https://governance.openstack.org/tc/goals/selected/ussuri/drop-py27.html [3] https://www.python.org/dev/peps/pep-0238 [4] https://www.python.org/dev/peps/pep-3105 [5] https://www.python.org/dev/peps/pep-3112 [6] https://www.python.org/dev/peps/pep-0343 [7] https://www.python.org/dev/peps/pep-0328 Change-Id: I732a57361319687ca0a64693f0e60bc0d8f5b3d2
* Fail gracefully when MD5 is unavailableBrian Rosmaita2020-05-043-3/+30
| | | | | | | | | 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>
* Pass --all-stores, --allow-failure as bool to APIAbhishek Kekane2020-04-081-3/+3
| | | | | | | | | | | Newly added command line options --all-stores, --allow-failure are boolean but we are passing it as a string to glance API. This will cause problem if those parameters are not converted to boolean at API side. Passing these parameters as boolean instead of string to API. Change-Id: I8d4eab9241fc9bb24bc40b47bf18d63c86a97d77 Closes-Bug: #1871674
* Update hacking for Python3Andreas Jaeger2020-04-028-17/+21
| | | | | | | | | | | | 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
* Merge "update doc url to new"Zuul2020-03-261-2/+2
|\
| * update doc url to newlvxianguo2018-08-161-2/+2
| | | | | | | | Change-Id: I35e03b74f7ef79a0997dfd931f29b20350537189
* | Delete image from specific storeErno Kuvaja2020-03-203-0/+49
| | | | | | | | | | | | | | 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-272-1/+110
| | | | | | | | | | | | | | | | 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-273-11/+272
| | | | | | | | | | | | | | | | | | | | | | 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 "Cleanup session object"Zuul2019-12-111-0/+9
|\ \
| * | Cleanup session objectAlex Schultz2019-08-011-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a session object is not provided to the get_http_client function (as is done via osc), the glance client uses it's own HTTPClient class. This class creates a session but does not properly close it when it is done. This can lead to resource warnings about unclosed sockets. This change adds a __del__() to the HTTPClient class to close out the session correctly. Change-Id: Idccff338fa84c46ca0e429bb533a2a5217205eef Closes-Bug: #1838694
* | | Merge "Rename --backend to --store"2.17.0Zuul2019-09-132-43/+43
|\ \ \ | |/ / |/| |
| * | Rename --backend to --storeAbhishek Kekane2019-05-142-43/+43
| | | | | | | | | | | | | | | | | | | | | | | | As a part of vocabulary correction renamed --backend parameter to --store. Modfied corresponding tests as well. bp:multi-store-vocabulary-correction Change-Id: I3dc115f5f0f3c4edcca0209e139aa3d1d816357c
* | | Merge "Trivial: fix image format typo"Zuul2019-07-311-1/+1
|\ \ \
| * | | Trivial: fix image format typoLucian Petrut2019-07-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Glance V1 image format list contains "VDHX", which is a typo. This change fixes it, using the correct format name, which is "VHDX". Luckily, this seems to be used only as part of a help string. Change-Id: I392f25b3ee0ee9ac6024e1670053191e4bba937a