summaryrefslogtreecommitdiff
path: root/glanceclient/v1/shell.py
Commit message (Collapse)AuthorAgeFilesLines
* 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-081-2/+1
| | | | | | | | | | | | | 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
* Fixed grammar in image-download command descriptionIhar Hrachyshka2016-06-011-1/+1
| | | | Change-Id: Ie18e1bee3376fdc01685c6f1d3a949c6934296b3
* 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
* 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
* 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
* | 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
* | 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 "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-051-2/+2
| | | | | | | | | | | | | | | | | | | | 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-271-2/+4
| | | | | | | | | | | | | | 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
* | 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
* '--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-121-10/+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
* Convert passed integer values into int in v1 shellCindy Pallares2014-06-121-9/+9
| | | | | | | Add the type to the parameters that require an integer in the V1 shell to avoid sending an improper request. Change-Id: Idb1ed39b11ca737fdd42d24e297c142f28dce35c
* Fix help text in image-createJuan Manuel Olle2014-06-031-1/+1
| | | | | | | Image-create help text makes reference of a non existing parameter --copy_from Change-Id: I26d584c350734bb26a6cf965a2198f0782dd0a9f
* Merge "Improve help strings"Jenkins2014-03-161-2/+2
|\
| * Improve help stringsAndreas Jaeger2014-02-261-2/+2
| | | | | | | | | | | | | | | | Make help strings consistent to use "." at end of string. Fix capitalization of API in one help string. Change-Id: I7cc5289d881c5e58aad9c69b4668584cdeb0b376
* | Only show progress bar for local image filesJon Bernard2014-01-311-1/+2
|/ | | | | | | | | | | This patch fixes a bug where both 'location' and 'progress' are passed as command line arguments. In this case, the 'data' field is not present in the fields dict and therefore the progress option cannot be used. A check is added to make sure the user has specified both a local image file and the progress flag together. Change-Id: Ia563139ee8b56d54d480534986e4b619a503fbfc Closes-Bug: #1259357
* Using common method 'bool_from_string' from oslo strutilsllg82122014-01-241-5/+10
| | | | | | | | | Using common method 'bool_from_string' from oslo strutils to replace utils.string_to_bool. partially implements blueprint common-client-library-2 Change-Id: I23924db3000feadcfe823c6cc979ea9752a13fa9
* Python 3: use six.iteritems() instead of iteritems()Yassine Lamgarchal2014-01-091-1/+2
| | | | | | | Six.iteritems() replaces dictionary.iteritems() on Python 2 and dictionary.items() on Python 3. Change-Id: I12fda5f20d2f4fe8227e45b2fe46b332f63deb97
* Get better format for long lines with PrettyTableFei Long Wang2014-01-061-3/+6
| | | | | | | | | | | | | Based on current implement, the cli output format will be bad if the lines are too long. This issue can be fixed by setting 'max_width'. However, there is a bug against it, see https://code.google.com/p/prettytable/source/browse/trunk/CHANGELOG?r=85 line 3. So the requirements.txt is updated as well. docImpact Fixes bug 1251283 Change-Id: I0d4192ad9d10a3d6d47a8319463a5edb57719a68
* Fix and enable gating on H306Dirk Mueller2013-12-161-2/+2
| | | | | | H306 - module imports should be in alphabetical order Change-Id: I1f8fc25b0e6ca23c21c90bda420f42a45141c2e2
* Merge "Replace OpenStack LLC with OpenStack Foundation"Jenkins2013-11-151-1/+1
|\
| * Replace OpenStack LLC with OpenStack FoundationZhiQiang Fan2013-09-201-1/+1
| | | | | | | | | | Change-Id: I38dcbcf1a6c8efe540fcf5f29e782cb3826e583d Fixes-Bug: #1214176
* | Merge "Fix python 3.x related Hacking warnings"Jenkins2013-11-121-10/+12
|\ \
| * | Fix python 3.x related Hacking warningsDirk Mueller2013-08-261-10/+12
| | | | | | | | | | | | | | | | | | | | | | | | Convert print operator usages to print functions. Fix one instance of outdated "except x,y:" syntactical construct. Remove usages of local() in string formatting alongway. Change-Id: Id0673a9183a6ea6bd9bf3f5c6d8e7c5f114ebf01
* | | Add CLI for V2 image create, update, and uploadeddie-sheffield2013-10-021-30/+1
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | Provides command line support for image-create, image-update, and image-upload using the Glance V2 API. This includes building help text for create and update based on the image jsonschema as fetched from the server. Also fixes bug caused by default warlock patch generation not matching what Glance expects when updating a core property which had not originally been set when the image was created. Related to bp glance-client-v2 Change-Id: I841f9e3d05802f4b794cb6f4849abe03ff0324d9
* | Fix glanceclient usage inconsistences for optionsGabe Westmaas2013-08-251-5/+5
|/ | | | | | | | | | Enumerated options should have the same format for all enumerated options. This commit moves all options to the {option1,option2} format. fixes bug: #1155171 Change-Id: I8e0ecf3896c76021cb027cbbbb3b5564a04aacec
* Revert "removed deprecated parameter --public"Dean Troyer2013-08-191-1/+6
| | | | | | | | | | | While trunk devstack was updated for this, stable/folsom and stable/grizzly are not and grenade is now broken. I'm not sure how long --public was undocumented but it may be that certain cli args may need to remain deprecated but supported for longer than we wish. This reverts commit ce8636b6b3c4b606483cfb2bc405d86224f309bc Change-Id: I91d4884e470c8fcc611dae62a30fa22d08dbec03
* Merge "removed deprecated parameter --public"Jenkins2013-08-191-6/+1
|\
| * removed deprecated parameter --publicChristian Berendt2013-07-301-6/+1
| | | | | | | | | | | | | | | | | | As noted by bcwaldon the parameter can be removed after updating Devstack. Should be done after merging the following change: https://review.openstack.org/#/c/39323/ Change-Id: I8d0f7ab4cccccf022446374a31e03ac913cfb136