summaryrefslogtreecommitdiff
path: root/openstackclient/image/v1/image.py
Commit message (Collapse)AuthorAgeFilesLines
* Remove 'get_osc_show_columns_for_sdk_resource' duplicatesStephen Finucane2021-10-211-6/+7
| | | | | | | | | | | | There were a number of 'get_osc_show_columns_for_sdk_resource' defined in-tree. However, osc-lib has provided this method for some time (since 2.2.0, June 2020 [1] - our minimum version is currently 2.3.0) so there's no need to provide our own copies. Remove them. [1] https://github.com/openstack/osc-lib/commit/29a0c5a5 Change-Id: I25695f4f9a379dd691b7eaa1e3247164668ae77e Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* stop image downloads to memorySimon Merrick2020-11-251-1/+5
| | | | | | | | | | + Fixes issue with large images hogging memory + stream image downloads + output to stdout if file not specified Change-Id: Ia01ff9b21a2dac5d0ccf2bd58a8640e88c5cbb36 Story: 2007672 Task: 39776
* Complete switch from glanceclient to SDK for image serviceArtem Goncharov2020-03-241-65/+73
| | | | | | | | | In https://review.opendev.org/#/c/650374/ a work has been started to switch image service support from glanceclient with all it's dependencies to the SDK version. With this change version 1 (anyway deprecated since ages) is also being switched to SDK. Change-Id: Ic391500af02a73d81d64a9e9113cca85c9e24390
* Replace six.iteritems() with .items()lihaijing2020-01-091-3/+2
| | | | | | | | | | | | | | | | 1. As mentioned in [1], we should avoid using 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 Co-Authored-By: Akihiro Motoki <amotoki@gmail.com> Change-Id: I4b9edb326444264c0f6c4ad281acaac356a07e85 Implements: blueprint replace-iteritems-with-items
* Use cliff formattable columns in image commandsAkihiro Motoki2019-06-221-15/+18
| | | | | | | | | | Related functional tests are converted into JSON format. Otherwise, it is not easy to check results. Partial-Bug: #1687955 Partially implement blueprint osc-formattable-columns Change-Id: Ib82e15738544975fede0c54cc5eaf239f4c67277
* Remove deprecated image commandsDean Troyer2019-05-191-28/+2
| | | | | | | * Remove ``image create|set`` option ``--owner`` Change-Id: I1fabab98c8660eba6d0dd75e74544c6c9d432b9e Signed-off-by: Dean Troyer <dtroyer@gmail.com>
* Remove code migrated to osc-lib long agoDean Troyer2019-05-161-1/+1
| | | | | | | | | * Remove openstackclient.api.utils and use osc_lib.api.utils * Remove openstackclient.common.clientmanager.ClientManager.auth_ref * Remove openstackclient.common.commandmanager Change-Id: I67e1dbc53cc0b37967c0011bcb2fc09bdef62d94 Signed-off-by: Dean Troyer <dtroyer@gmail.com>
* Clean up W503 and E402 pep8 errorsSean McGinnis2018-04-151-5/+5
| | | | | | | | | | | | pycodestyle 2.40 and later enforce these rules that were not previously enforced. Rather than just skipping them, this cleans up the trivial instances of these violations. This does also include some other updates that were not triggering errors in an attempt to keep some of the style consistent. Change-Id: Id7c0a6b8f1f835e69d844b000e3ed751852ada63 Closes-bug: #1762803
* Accept 0 for --min-disk and --min-ramShogoAdachi2017-10-201-2/+4
| | | | | | | | | | | | | | The current openstackclient implementation cannot accept 0 for --min-disk and --min-ram with the "openstack image set" command. If theses options get set to 0, the option parser in openstackclient wrongly interprets 0 as no option value. The 0 is valid for these options if administrators want to make it the default(no minimum requirements). This patch fix the parser so that it avoids only 'None'. Change-Id: Ie8ee37484c02c26f54adc56263fcd167c0ce7eb3 Closes-bug: #1719499
* Merge "To display image size in human friendly format"Jenkins2017-06-011-0/+9
|\
| * To display image size in human friendly formatBadhmapriya Boopalan2017-01-111-0/+9
| | | | | | | | | | | | | | | | | | | | Include option '--human-readable' to 'image show' command. This option displays image size in human readable format (such as K, M, G, T,..) Related Commit: I0ef74c2ec978483fe49156c88acf5c369a8fa5c2 Closes-Bug: #1640086 Change-Id: I28cd5702925d51303d0607ed8dccf12c56434682
* | openstack image create : --file and --volume exclude each otherDavid Rabel2017-02-241-2/+3
| | | | | | | | | | | | | | | | Added parser.add_mutually_exclusive_group() for --file and --volume in openstack image create. Change-Id: I4d9fc6314801d569354e5644e231ddd6c7f1853d Closes-Bug: 1666551
* | Update container format choicesBrian Rosmaita2017-01-231-6/+10
| | | | | | | | | | | | | | | | | | | | The choices for valid container formats is out of date in the image v1 and v2 help text. This patch adds 'ova' and 'docker' and does some minor refactoring to align the container_format option with the disk_format option. Change-Id: Icdea5fab801abd651baf45cf96c920c7df79f11b Closes-bug: #1658138
* | Add ploop to supported disk formatsMikhail Feoktistov2016-12-151-1/+1
| | | | | | | | | | | | | | | | This format is used for containers for Virtuozzo hypervisor Closes-Bug: 1650342 Change-Id: Ic79f29a1fe9ea5016d3d5520c2b06e39da01ff61
* | Merge "Sort list images by name by default"Jenkins2016-12-021-1/+2
|\ \
| * | Sort list images by name by defaultVijendra Soni2016-11-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Set the default key and dir for openstack image list, if no command line argument passed Changing sort_key to name(old value: created_at) Change-Id: I6c61f6e5a04824d655ccf43477afcec9652101df Closes-Bug: #1639231
* | | clean up image choices and help textSteve Martinelli2016-11-231-7/+8
| |/ |/| | | | | | | | | | | | | | | | | | | Use choices for image set and image create commands, this aligns with our use of choices in networking commands. Also update the help text to match that of the networking commands, where we iterate through the options. Related-Bug: 1635518 Change-Id: Ib4c66b06e07f1d4e5bfe1b74053f2215cccad890
* | Merge "Show disk format vhdx in help"Jenkins2016-11-221-1/+1
|\ \
| * | Show disk format vhdx in helpJaspreet Singh Rawel2016-11-111-1/+1
| |/ | | | | | | | | | | | | | | Currently disk format type vhdx is missing in help. Closes-Bug: 1635518 Change-Id: Ibe5976f722c4eb966b12a7b1e1c2702fd08ce84b
* | translate all command help strings3.4.0Steve Martinelli2016-11-171-6/+6
|/ | | | | | | | | | | | | | Leverage the new cliff command class attribute (_description) to get the help of a command, this allows us to mark strings for translation. We could not do this before since the help was grabbed from the docstring. This also depends on a new release of cliff and a bump to the minimum level in osc's requirements. Closes-Bug: 1636209 Depends-On: Id915f6aa7d95a0ff3dc6e2ceaac5decb3f3bf0da Change-Id: I8673080bb5625e8e3c499feaefd42dfc7121e96f
* image list: Add Checksum columnMarc Abramowitz2016-07-111-0/+2
| | | | | | | | | The checksum could potentially be useful for spotting duplicated images or checking if images with the same name are identical or different. Closes-Bug: #1602073 Change-Id: Ia0c41970c846d550de14297e18bc738e847e5a3b
* Make set/unset commands in compute/image/common return normally when nothing ↵Tang Chen2016-06-211-4/+0
| | | | | | | | | | specified After this patch, all set/unset commands will return normally when nothing specified. Change-Id: Id94d0329faa1a674006a9aae901f834b41917317 Close-bug: #1588588
* Standardize logger usageTang Chen2016-06-201-12/+11
| | | | | | | | | | | | | | | | | | | Use file logger for all command specific logs. This patch also fixes some usage that doesn't follow rules in: http://docs.openstack.org/developer/oslo.i18n/guidelines.html After this patch, all self.log and self.app.log will be standardized to LOG(). NOTE: In shell.py, we got the log in class OpenStackShell, which is also known as self.app.log in other classes. This logger is used to record non-command-specific logs. So we leave it as-is. Change-Id: I114f73ee6c7e84593d71e724bc1ad00d343c1896 Implements: blueprint log-usage
* osc-lib: commandDean Troyer2016-06-131-1/+1
| | | | | | | Leave command.py and test_command.py as a sanity check during the deprecation period. Change-Id: I24e1b755cbfbcbcaeb5273ec0c9706b82384fc85
* osc-lib: parseractionsDean Troyer2016-06-131-2/+2
| | | | | | | Leave parseractions.py and test_parseractions.py as a sanity check during the deprecation period. Change-Id: I1a7469b6d872284e0276502a1a287bc0b87f8f83
* osc-lib: utilsDean Troyer2016-06-131-1/+2
| | | | | | | | Use osc-lib directly for utils. Leave openstackclient.common.utils for deprecation period. Change-Id: I5bd9579abc4e07f45219ccd0565626e6667472f7
* Fix i18n support for help and log.warning in imageXiaoyang Zhang2016-05-191-63/+65
| | | | Change-Id: I6e2764aaf4b8c0efa78872646a7b3482ba044dc8
* Fix return value of "image set" commandTang Chen2016-02-291-1/+1
| | | | | | | "image set" command should return None. But in one path, it returns ({}, {}). This patch fixes this. Change-Id: I3847e661cb7e89863921a3f0a859d9b1a8077ede
* Fixed a bunch of spacingBrandon Palm2016-02-231-4/+4
| | | | | | | Nothing too complicated here. I fixed a bunch of spacing issues that I saw in OSC. Change-Id: I935ab48e7c5bac5f88ecdb3a05f73fb44fc9f41d
* log take_action parameters in a single placeAkihiro Motoki2016-02-021-30/+4
| | | | | | | | | | | | Previously each command logs take_action parameters explicitly by using @utils.log_method decorator or log.debug(). Some commands have no logging. This commit calls a logger in the base class and drops all logging definition from individual commands. Closes-Bug: #1532294 Change-Id: I43cd0290a4353c68c075bade9571c940733da1be
* Change --owner to --project in image commandsDean Troyer2016-01-151-11/+54
| | | | | | | | | | * image create and image set now use --project to specify an alternate project to own the image * --owner is still silently accepted but deprecated, add warning messages * --project and --owner are mutually exclusive to prevent precedence issues Closes Bug: 1527833 Change-Id: Iccb1a1d9175ef9b5edcd79d294607db12641c1f0
* Trivial: Remove useless return from files in image and volumeTang Chen2015-12-181-2/+0
| | | Change-Id: I3526ecd202d0908d91305a066ad72d03cee794b5
* Add status column for "openstack image list"xiexs2015-11-291-2/+7
| | | | | | | | | Actually, the status column is useful for the user. So, it`s better to output this info by default (or, user had to specify the extra option, i.e. --long). Change-Id: Id2a9f86f0de5310f8f5ff9a46bf1b7411094b519 Closes-Bug: #1519181
* Merge "image set should not show the resource"Jenkins2015-10-081-7/+3
|\
| * image set should not show the resourceSteve Martinelli2015-10-061-7/+3
| | | | | | | | | | | | | | | | the rest of OSC set commands do not show the resource after it has been updated. unless the update fails then we report back a failure, otherwise the user should assume everything went fine. Change-Id: I2bd4188450c3853b4a1bc25f80fc9450cda32bdd
* | Image fix bug with --volumeNiallBunting2015-09-181-12/+14
|/ | | | | | | | | | Currently after calling the cinderclient to create an image from a volume, it also then tries to create another image. This fails as the keyword volume is unexpected. This add checks so the image is not created in this case. Allowing --volume to not throw an error when it has worked. Change-Id: I67e650eb0b8c331d86515e3e326c39a5d6dad5e1 Closes-Bug: 1497221
* Merge "Move update code from image create command"Jenkins2015-07-021-38/+104
|\
| * Move update code from image create commandMarek Aufart2015-07-021-38/+104
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Openstack image create command updates existing image (with same name) by default. That might be confusing since glance allows create multiple images with same names and may lead to unwanted image update by image create command. Image update code was moved from image create action to image set action. BackwardsIncompatibleImpact Change-Id: I1686c6544c366262efab9e33c066d5f8a667f707 Closes-Bug: #1461817
* | Add functional tests for image setTerryHowe2015-06-161-0/+3
|/ | | | | | | | | | | | | | | | This patch includes functional tests for image set and it includes a change to use the OSC utils.format_dict method to format the properties. This will give a more user friendly format to the image commands and it gives a more consistent testable format to the output. Instead of: {u'a': u'b', u'c': u'd'} The user will see: a=b, c=d Change-Id: Ib396316586ffc5dbab231064d5b6dc9425507934
* Add missing properties to image set commandAmey Bhide2015-05-251-1/+24
| | | | | | | | Enable user to update the following image properties from OSC: container-format, disk-format, size Closes-Bug: #1446362 Change-Id: Id9f40f15702e8f14f0327a37fcc7d7971338c258
* Fix tiny typo in comment messageLin Yang2015-04-301-1/+1
| | | | | | | compatability => compatibility Change-Id: I3181fb2b83df1e2cb60a9eedf319f2ad0a487dba Signed-off-by: Lin Yang <lin.a.yang@intel.com>
* Merge "Handle the pagination for image list"1.1.0Jenkins2015-04-201-1/+11
|\
| * Handle the pagination for image listTerryHowe2015-04-201-1/+11
| | | | | | | | | | | | | | Handle the paginatiion for image list. We were sorting the data here, so nothing lost for the generator. Change-Id: I2d7d4b3d5c9f650953f309c971ac53b64f6f7f77
* | Fix skipped image create attribute location attrMarek Aufart2015-04-171-1/+1
|/ | | | | | | | | | Image create action accepts attribute called location, in method body is list of allowed attributes, which contain localtion, what is typo and this attribute was not passed to glance. Fixed. Change-Id: I357b06b63b8aa97f7a5f587ef3fcee7a4b360ed1 Closes-Bug: #1445460
* Add sort support to image listzhiyuan_cai2015-02-061-0/+10
| | | | | | | | | | Add sort support to image list by sorting items in the client side. The parameter syntax follows this spec[1]. [1] https://review.openstack.org/#/c/145544/ Change-Id: I42b487d18f00f937db1938daa46487cea2a896ab Closes-Bug: #1410251
* Add filter to image listDean Troyer2015-01-271-11/+85
| | | | | | | | | | | | | | | * Hides previously broken --page-size option * Adds --property to image list for filtering on properties * Adds Visibility, Protected, Owner, Properties/Tags to --long output * Adds api.utils.simple_filter() for selecting matches out of a list of objects * Adds tests for all of the above * Updates image docs There are additional filtering options to be added in later reviews. Change-Id: I32feff0ad61aae749b33621c817658d7dc90c3aa Closes-bug: 1401902
* Begin low-level API for Image v1 and v2Dean Troyer2015-01-201-2/+23
| | | | | | | | | image list for v1 and v2: * Add --public|--private to command parsers * Implement local public/private filtering for v1 image_list() * Pass public/private filter to server for v2 image_list() Change-Id: Ie7c24ea2d1bf2b3b1b7fa342eb45fee45894634d
* Command doc: imageSteve Martinelli2015-01-091-10/+10
| | | | Change-Id: Ib1563b58351315dc2a44ad77882f8c834a1214c0
* add multi-delete support for compute/image/net/volumewanghong2014-12-231-8/+10
| | | | | | | | | | | | | | This is part1, add support for these objects: compute.server imagev1.image imagev2.image network.network volume.volume volume.backup volume.snapshot Closes-Bug: #1400597 Change-Id: Ice21fee85203a8a55417e0ead8b509b8fd6705c1
* Close files on image createDean Troyer2014-10-141-23/+30
| | | | | | | The file opened for --file was never closed. Close it if it is a file object. Change-Id: I7bd120a2413de42339771d01e8fd1894d38c3011