summaryrefslogtreecommitdiff
path: root/glanceclient/v1
Commit message (Collapse)AuthorAgeFilesLines
* Merge "Do not use the six library."Zuul2020-07-174-21/+14
|\
| * Do not use the six library.Cyril Roelandt2020-06-234-21/+14
| | | | | | | | Change-Id: I3dbfcfa0f5f590a41ed549afd44537d8ed41433a
* | Stop to use the __future__ module.Hervé Beraud2020-06-021-2/+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
* 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
* Update hacking versionjacky062019-03-271-4/+4
| | | | | | Use latest release 1.1.0 and compatible changes w.r.t pep8 Change-Id: Ifc3b96d98c1a7feff187f953d487e12135887fb9
* help text for container_format, disk_formatM V P Nitesh2017-07-061-2/+3
| | | | | | | Updated the container_format and disk_format in v1 help text. Change-Id: I4ebe4982c179450defe8ad5703999f4074ae32f8 Closes-Bug: #1659010
* Replace six.iteritems() with .items()ji-xuepeng2017-02-084-9/+8
| | | | | | | | | | | | | 1.As mentioned in [1], we should avoid usingg six.iteritems to achieve iterators. We can use dict.items instead, as it will return iterators in PY3 as well. And dict.items/keys will more readable. 2.In py2, the performance about list should be negligible, see the link [2]. [1] https://wiki.openstack.org/wiki/Python3 [2] http://lists.openstack.org/pipermail/openstack-dev/2015-June/066391.html Change-Id: I71c13040318eca6e5ed993e8aa03f8003986a71c
* Add ploop in disk_formatEvgeny Antyshev2017-01-191-1/+1
| | | | | | | | | | | | "ploop" image format is supported in upstream Glance https://review.openstack.org/341633 And similar patch has been added in python-openstackclient: https://review.openstack.org/411405 Co-Authored-By: yuyafei <yu.yafei@zte.com.cn> Change-Id: I1471224df97cf5fecfe7f02e549855af81c45848 Related-Bug: 1650342
* Move old oslo-incubator code out of openstack/commonAbhishek Kekane2016-11-087-3/+1107
| | | | | | | | | | | | | | | | | As part of the first community-wide goal, teams were asked to remove the openstack/common package of their projects if one existed. This was a byproduct of the old oslo-incubator form of syncing common functionality. Package openstack/common/apiclient is moved to glanceclient/v1 package as it is used by v1 api only. NOTE: Removed glanceclient/common/base.py as it is deprecated and not used anywhere. Closes-Bug: #1639487 Change-Id: Ib3ac09743ce761ab0186e99e1c9de02517f89510
* Fixed grammar in image-download command descriptionIhar Hrachyshka2016-06-011-1/+1
| | | | Change-Id: Ie18e1bee3376fdc01685c6f1d3a949c6934296b3
* Corrected wrong parameter in docstringPranaliD2016-05-021-1/+1
| | | | | | | | | | | In docstring of list() method of glanceclient/v1/images.py, parameter 'return_request_id' used within **kwargs is 'return_req_id', not 'return_request_id'. Changed 'return_request_id' to 'return_req_id'. Change-Id: I7f4a2a5af1b13184c67fa81be971dc5139569f8b Closes-Bug: 1573049
* Add versions list functionwangxiyuan2015-11-102-0/+28
| | | | | | | | | This patch add a function to query the Glance API versions. DocImpact Change-Id: I21eeaee3db4ae23f608b68bb319772ac612975b4 Closes-bug: #1511180
* Merge "Add support for setting Accept-Language header"Jenkins2015-10-141-0/+2
|\
| * Add support for setting Accept-Language headerFrode Nordahl2015-10-141-0/+2
| | | | | | | | | | | | DocImpact Closes-Bug: 1480529 Change-Id: I35a37d55edb700a5993bd5cc352335a87a15e47a
* | Add period in help messageAtsushi SAKAI2015-09-191-1/+1
| | | | | | | | | | | | | | Command help message uses help and CLI-Reference generation. and in convention, help message stops with period ".". Change-Id: I652afdb5e4d69a0476a0a2dc313ae60ece3b7bbc
* | Invalid output running the command 'glance image-show <image_id>'David Sariel2015-09-091-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | Running the command returns the string 'id' and fails on exception. In function _image_meta_from_headers the meta variable was not properly set because key was not lowercased. Converting key to lowercase solves the problem. NOTE: this is a compatibility fix for urllib3 >= 1.11 Closes-Bug: #1487645 Co-Authored-by: Flavio Percoco <flavio@redhat.com> Change-Id: I1b0b327163577585becb5e762536058d21dc1c98
* | Require disk and container format on image-createGorka Eguileor2015-08-141-0/+2
|/ | | | | | | | | | | | | | | Currently glanceclient doesn't enforce disk-format or container-format presence in the command line on image-create when providing image data (with --file, --location, --copy-from), which means that the POST request is made with the whole image and error is reported by Glance API. This post enforces presence of those arguments when image data is provided so we can get the error quicker and avoid sending unnecessary data over the network. Change-Id: I5914fa9cfef190a028b374005adbf3a804b1b677 Closes-Bug: #1309272
* Enable flake8 checksDarja Shakhray2015-07-212-5/+5
| | | | | | | | | | | | This commit enables new flake8 checks: * E265 block comment should start with '# ' * H405 multi line docstring summary not separated with an empty line * E123 closing bracket does not match indentation of opening bracket's line * H238 old style class declaration, use new style (inherit from `object`) * E128 continuation line under-indented for visual indent and makes related changes in the code. Change-Id: Ie993afc930f6b74d7a990bcaa9fc0e9f5ba1585c
* Import only modules and update tox.iniCindy Pallares2015-06-171-4/+4
| | | | | | | | | As stated in the OpenStack Hacking Guidelines, it is prefered that only modules should be imported. Also updated tox.ini to ignore opestack/common among others. Change-Id: I2f0a603c31052eadee581c11880c0ec6bd392829
* Merge "Add parameter 'changes-since' for image-list of v1"Jenkins2015-06-151-1/+7
|\
| * Add parameter 'changes-since' for image-list of v1Fei Long Wang2015-05-061-1/+7
| | | | | | | | | | | | | | | | | | | | Now Glance /images/detail API of v1 supports parameter 'changes-since' to query deleted images. But it's missed in client. This patch will add the parameter. Related-Bug: #1432701 Change-Id: Id38e3a78b4b2ef680ea04d35e32beb4b9c8efa00
* | Make glanceclient accept a session objectJamie Lennox2015-06-111-4/+3
| | | | | | | | | | | | | | | | | | | | | | To make this work we create a different HTTPClient that extends the basic keystoneclient Adapter. The Adapter is a standard set of parameters that all clients should know how to use like region_name and user_agent. We extend this with the glance specific response manipulation like loading and sending iterables. Implements: bp session-objects Change-Id: Ie8eb4bbf7d1a037099a6d4b272cab70525fbfc85
* | Merge "Check image-download for redirection"Jenkins2015-05-251-3/+8
|\ \ | |/ |/|
| * Check image-download for redirectionCindy Pallares2015-05-051-3/+8
| | | | | | | | | | | | | | | | | | Currently when you download an image without specifying a file or redirecting the output, the image is dumped into the console as gibberish. We can avoid this if we check if file is being redirected or if a file is specified. Change-Id: I257760752f05b82b935cf19fb10573ee7ff1395d
* | Merge "Correct help messages for image-update command"0.18.0Jenkins2015-04-181-2/+4
|\ \
| * | Correct help messages for image-update commandAbhishek Talwar2015-03-191-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently when you are trying to update the location of an image which is not in queued status you will get an error from the Glance API. The help message for --location and --copy-from arguments should be updated to inform the user that it works only for images in queued status. Co-Authored-By: Abhishek Talwar <abhishek.talwar@tcs.com> Co-Authored-By: Kamil Rykowski <kamil.rykowski@intel.com> Change-Id: I82b14ffde3f301d7ffef68e984ba4ad2ae0f8b0f Closes-Bug: #1220809
* | | Don't accept *args for clientJamie Lennox2015-03-281-2/+2
| |/ |/| | | | | | | | | | | The HTTPClient object that we are passing *args to does not accept any args. Don't accept them from the main client interface. Change-Id: I473bb64be95e058375ebd1e55d4bda4168c3c430
* | Import sys moduleJimmy McCrory2015-03-141-0/+1
| | | | | | | | | | | | | | This module is required by the _is_image_data_provided function. Change-Id: I78265209a2f80aaf61bbe25d69e79c939182516c Closes-Bug: 1432249
* | Merge "Fix leaking sockets after v1 list operation"Jenkins2015-03-111-54/+83
|\ \
| * | Fix leaking sockets after v1 list operationLouis Taylor2015-03-041-54/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since the move to using the requests library, v1 list operations keep the connection open to the glance server. This is normally closed by the garbage collector if it is not explicitly closed, however the paginate function used by the list method had a circular reference preventing it from ever being collected during the lifecycle of a service consuming glanceclient. This is problematic, since it causes long running nova processes to run out of file descriptors for new connections. This patch makes paginate() non-recursive, which allows the connection to be freed. Change-Id: I16a7b02f2b10e506e91719712cf34ef0aea1afc0 Closes-Bug: 1423939
* | | Merge "Show error on trying to upload to non-queued image"Jenkins2015-03-041-0/+18
|\ \ \ | |/ / |/| |
| * | Show error on trying to upload to non-queued imageLouis Taylor2015-02-191-0/+18
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, attempting to upload data to an image which has a status which is not 'queued' would appear to succeed, when the data has actually never been sent to the glance server. To the user, it appeared that their request was successful. This patch adds a check for incoming image data on the 'image-update' command, and exits with an error if the specified image does not have the status 'queued'. Examples: $ cat os.img | glance image-update d50b0236-b27c-412a-91b9-18ceafa9cc5a Unable to upload image data to an image which is active. $ glance image-update --file os.img d50b0236-b27c-412a-91b9-18ceafa9cc5a Unable to upload image data to an image which is killed. Change-Id: I91bbd7f86d5851a5e35946c711dba1932283ed79 Closes-Bug: #1395084
* | Merge "Glance image delete output"Jenkins2015-02-201-0/+3
|\ \ | |/ |/|
| * Glance image delete outputAbhishek Talwar2015-02-171-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Deleting an already deleted image using admin user is throwing an error "404 Not Found" which is confusing. Deleting an image that does not exist throws "No image with a name or ID of 'image-id' exists." Updated the code so that trying to delete an already deleted image throws "No image with an ID of 'image-id' exists." error. Closes-Bug: #1333119 Change-Id: I8f9a6174663337a0f48aafa029a4339c32eb2134 Co-Authored-By: Abhishek Talwar <abhishek.talwar@tcs.com> Co-Authored-By: Kamil Rykowski <kamil.rykowski@intel.com>
* | Change oslo.utils to oslo_utilsLouis Taylor2015-02-052-4/+4
| | | | | | | | | | | | | | | | | | | | The oslo.utils libraries are moving away from namespace packages. This requires oslo.utils>=1.2.0 bp drop-namespace-packages Change-Id: I803df61e91eabb96329d859aef6bea03530fb84f
* | Merge "Use utils.exit rather than print+sys.exit"Jenkins2015-02-051-5/+4
|\ \
| * | Use utils.exit rather than print+sys.exitLouis Taylor2015-02-031-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This replaces the use of a pattern along the lines of print(error message) sys.exit(1) in a couple of place in the shell. utils.exit does much the same job, but outputs to stderr. Change-Id: I1d3b52e0685772c10aa806a8f208eb6dd7a0e7ef
* | | Merge "Disable progress bar if image is piped into client"Jenkins2015-02-041-3/+6
|\ \ \
| * | | Disable progress bar if image is piped into clientLouis Taylor2015-01-061-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, running: cat something.img | glance image-create --progress --container-format=bare --disk-format=raw or cat something.img | glance --os-image-api-version 2 image-upload --progress <image id> would result in an error. This error was caused by the length of the input being unknown, so the overall progress cannot be found. This patch disables the progress bar whenever the size of the input file cannot be determined. Change-Id: I6bfef7441864b638194126880241cc2c96d5b18b Closes-Bug: #1402746
* | | | Merge "Add validation to --property-filter in v1 shell"Jenkins2015-02-041-0/+4
|\ \ \ \ | |_|/ / |/| | |
| * | | Add validation to --property-filter in v1 shellLouis Taylor2015-01-081-0/+4
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, using --property-filter with invalid arguments resulted in a rather cryptic error message: $ glance image-list --property-filter name dictionary update sequence element #0 has length 1; 2 is required Now, something which is human decipherable is printed: $ glance image-list --property-filter name Argument --property-filter requires properties in the format KEY=VALUE Change-Id: I61d19894fd8864bdca2fa3f627da3c7eb1341c51
* | | Remove openstack.common.strutilsLouis Taylor2015-01-272-5/+8
| | | | | | | | | | | | | | | | | | | | | This module now lives in oslo.utils, so import it from there instead. Co-Authored-By: Ian Cordasco <ian.cordasco@rackspace.com> Change-Id: Ib35dc840992433542490670781badd9529ec8947
* | | Merge "Make non-boolean check strict"Jenkins2015-01-231-5/+8
|\ \ \ | |/ / |/| |
| * | Make non-boolean check strictCindy Pallares2015-01-061-5/+8
| |/ | | | | | | | | | | | | | | | | Currently when we enter any non-boolean strings in the client, it accepts it and defaults the value to false. It should check if the strings are boolean values and respond with an error if they're not. Closes-Bug: #1394236 Change-Id: Ie498ee1b93524d91a43343f73140446c2cc9ab92
* | Fix Requests breaking download progress barLouis Taylor2015-01-041-2/+3
|/ | | | | | | | | | | The move to the requests library (dbb242b) broke the progress bar during downloading an image with --progress enabled, due to requests returning a generator, which has no __len__ function. This patch adds an iterable wrapper which provides the length, sourced from Content-Length headers. Closes-Bug: #1384664 Change-Id: I48598a824396bc6e7cba69eb3ce32e7c8f30a18a
* Don't require version to create Client instanceFlavio Percoco2014-12-091-3/+4
| | | | | | | | | | | | | | | | | | We currently require a version to always be passed to discover the client version that should be loaded. However, this information is commonly present in the URL instead. The current behavior forces consumers of the library to keep the required version around and/or to strip it themselves from the URL. This patch relaxes that requirement by making the version a keyword and requesting instead an endpoint to be passed. The patch gives priority to the version in the endpoint and falls back to the keyword if the later is not present. Follow-up patches will improve this code making it interact a bit more with the endpoint's catalog. Closes-bug: #1395714 Change-Id: I4ada9e724ac4709429e502b5a006604ca0453f61
* '--public' ignored on image createStuart McLaren2014-10-081-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, if '--public' is specified, an image is created but it is not marked as public: $ glance image-create --public --name minus-minus-public --disk-format raw \ --container-format bare < /etc/fstab +------------------+--------------------------------------+ | Property | Value | +------------------+--------------------------------------+ . . . | is_public | False | . . . +------------------+--------------------------------------+ This is inconsistent. '--public' has been deprecated for some time, and has been removed from devstack (https://review.openstack.org/#/c/39323/), so we can finally get rid of it. We now raise the standard error for unsupported arguments. Change-Id: I15d16f690f9bd92b4cefbc8ed36ed2d171ff22f3 Closes-bug: #1378844
* Remove deprecated commands from shellCindy Pallares2014-08-122-525/+2
| | | | | | | | | | 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
* 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-103-38/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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