summaryrefslogtreecommitdiff
path: root/openstackclient/compute/v2/flavor.py
Commit message (Collapse)AuthorAgeFilesLines
* Blacken openstackclient.computeStephen Finucane2023-05-101-89/+121
| | | | | | | | | | Black used with the '-l 79 -S' flags. A future change will ignore this commit in git-blame history by adding a 'git-blame-ignore-revs' file. Change-Id: I9af45c062d179ab3dc2a5e969e1c467932753a2b Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Speed up standard flavor list commandPavlo Shchelokovskyy2022-09-301-1/+1
| | | | | | | | | | | | | | | currently this command tries to fetch extra_specs for any flavor that does not have them (which is quite usual), regardless if the command was even asked to display them (--long) at all. This significantly slows down this command as it makes a lot of unnecessary REST calls, one per each flavor to fetch extra_specs for. With this patch, client only attempts to fetch flavor extra_specs if the user actually called the client with --long. Change-Id: Ia36414d891a41b641d7a9a04f0a1e7d43cfee351 Story: 2010343 Task: 46484
* Skip original_name from flavor infoArtem Goncharov2022-01-141-1/+1
| | | | | | | | In the new SDK we are going to add additional parameter to the flavor which make no use for OSC. Exclude it explicitly since it also cause failing tests. Change-Id: Ie35e60498cf18f05c878611df6f88607a04b1870
* trivial: Use plural for appended parametersStephen Finucane2021-01-061-9/+12
| | | | | | | | | Multiple compute commands take a '--property' parameter or variant thereof. These should be stored in a 'properties' (plural) dest for sanity's sake. Correct this. Change-Id: If393836925fa736404527d9abd212b8ac9931027 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Add 'flavor list --min-disk', '--min-ram' optionsStephen Finucane2020-12-091-7/+36
| | | | | | | | Allow us to filter on minimum disk and RAM, and close another gap with novaclient. Change-Id: Ib3f0bdf419675e1c35c3406fbac8a4c18ac56a33 Signed-off-by: Stephen Finucane <sfinucan@redhat.com>
* Switch compute flavors from novaclient/direct to SDKArtem Goncharov2020-12-021-122/+140
| | | | | | | | | | | Let's switch flavors from novaclient or direct API requests onto using SDK. Microversion agreement comes out of the box. SDK normalizes property names, while OSC uses server side names. In order not to break OSC users continue using server-side names. Depends-On: https://review.opendev.org/#/c/762989/ Change-Id: I62b2ed8488ee4ac9c42051311bcfb455506ddd90
* Fix formatting of the flavor propertiesArtem Goncharov2020-11-021-12/+47
| | | | | | | Do not stringify flavor properties to allow proper output formatting to json/yaml/etc Change-Id: I9f4c42acb85b726af87123134dd19de98fe95074
* Allow openstack flavor set to update flavor description using nameGabriel Ramirez2020-06-101-1/+1
| | | | | | | | | | | Modified take_action() method for SetFlavor to use flavor id instead of flavor name when setting description Closes-Bug: #1844708 Story: #2007781 Task: #40019 Change-Id: If6798c89fef4c9feb4ebb460722b891f5655037d
* 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
* Rename review.openstack.org to review.opendev.orgmelissaml2019-05-121-1/+1
| | | | | | | There are many references to review.openstack.org, and while the redirect should work, we can also go ahead and fix them. Change-Id: I82e3797dd4c05e4944f40c950b4fafe9a5334cbf
* Compute: Add description support for flavortianhui2018-06-201-1/+27
| | | | | | | Co-Authored-By: Fan Zhang <zh.f@outlook.com> Change-Id: I0dc80bee3ba6ff4ec8cc3fc113b6de7807e0bf2a Story: 2002196 Task: 21681
* flavor: clarify --swap descriptionChen Hanxiao2017-12-281-1/+1
| | | | | | | | | | --swap will add a additional storage device, which not affect the original swap partition/device. This patch will clarify this misleading description. Change-Id: Ic079c069985d39cc969b97876901007a81883f57 Signed-off-by: Chen Hanxiao <chenhx@certusnet.com.cn>
* Help/docs cleanups: marker, limit, ip-address metavarsDean Troyer2017-04-041-2/+2
| | | | | | | | | | | | Cleanup help strings and docs for clarity and to keep things consistent: * --limit metavar should be <num-resource> to indicate what is being counted * --marker metavar should be <resource> or <resource-id> to indicate the type of value being specified * <*-ip-address> metavars should be just <ip-address> as there is no difference in format between fixed and floating IPs * Move all occurances of '(name or ID)' to end of help text Change-Id: I2c31746ed6ded3845244e03e57d809f8bc0e6b9d
* Merge "Handle log message interpolation by the logger in compute/"Jenkins2017-02-141-4/+3
|\
| * Handle log message interpolation by the logger in compute/Gábor Antal2017-02-131-4/+3
| | | | | | | | | | | | | | | | | | | | According to OpenStack Guideline[1], logged string message should be interpolated by the logger. [1]: http://docs.openstack.org/developer/oslo.i18n/guidelines.html#adding-variables-to-log-messages Change-Id: Ib7b5fb5f794026fc8a84260c4803afea321a9cf5 Closes-Bug: #1596829
* | Overwrite/Clear Flavor propertyReedip2017-02-131-0/+17
|/ | | | | | | | | | This patch adds support to overwrite/clear the flavor's property using the new ``--no-property`` option in the ``flavor set`` command. Change-Id: I873c96fcf223bbd638a19b908766d904a84e8431 Implements: blueprint allow-overwrite-set-options Co-Authored By: zhiyong.dai@easystack.cn
* Fix flavor create help re swap size unitsPavlo Shchelokovskyy2017-01-121-2/+2
| | | | | | | | | | | nova actually expects and uses swap size in MB, while in openstackclient currently help states that swap must be specified in GB and passes this value to nova without changes. Fix the help string. Change-Id: I95f46246c072961ce77f818d80d75e6a51f728d0 Closes-Bug: #1656018
* Fix creating a private flavor with ID autoJens Rosenboom2017-01-051-1/+1
| | | | | | | | | When a private flavor is created with ID auto (=default) and a project is specified for it, instead of trying to add the project to the flavor called "auto" the ID of the newly created project should be used. Change-Id: I19f7a0ec26bd5d147f00ecba3312240e3601567e Closes-Bug: 1654221
* 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
* Add Support for showing flavor access listHuanxuan Ao2016-07-221-0/+20
| | | | | | | | | Add a attribute "access_project_id" for flavor object to display the access project id list by using "flavor show" command. Change-Id: I7f0c152b816e0ca2e32e47f9b5c1aa7663d33b6d Closes-Bug:#1575461
* Add "--property" option to "flavor create" commandHuanxuan Ao2016-06-291-3/+18
| | | | | | | | Add "--property" option to "flavor create" command to support adding properties to a new falvor. Change-Id: I4f06b364375d5a81584fe41122d48e9568fa712a Closes-Bug: #1596798
* Merge "Make set/unset commands in compute/image/common return normally when ↵Jenkins2016-06-221-6/+0
|\ | | | | | | nothing specified"
| * Make set/unset commands in compute/image/common return normally when nothing ↵Tang Chen2016-06-211-6/+0
| | | | | | | | | | | | | | | | | | | | specified After this patch, all set/unset commands will return normally when nothing specified. Change-Id: Id94d0329faa1a674006a9aae901f834b41917317 Close-bug: #1588588
* | Merge "Support bulk deletion for "flavor/aggregate delete""Jenkins2016-06-221-4/+19
|\ \
| * | Support bulk deletion for "flavor/aggregate delete"Huanxuan Ao2016-06-211-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | Support bulk deletion and error handling for "aggregate delete" and "flavor delete" commands. Change-Id: I3f6105cbeeab1c9f8cd571c63ce0e7ac3d4252b3 Partially-Implements: blueprint multi-argument-compute Partial-Bug: #1592906
* | | Add "--project" option to the "flavor create" command.Huanxuan Ao2016-06-211-0/+26
| |/ |/| | | | | | | | | | | | | Add ``--project`` and ``--project-domain`` options to the ``flavor create`` command. We can use these options to add the flavor access to a givin project when we create the flavor. Change-Id: Ic1907272c1d1ae526f9c9e86f32ba06c6da147c0
* | Standardize logger usageTang Chen2016-06-201-10/+12
|/ | | | | | | | | | | | | | | | | | | 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-1/+1
| | | | | | | 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/+1
| | | | | | | | Use osc-lib directly for utils. Leave openstackclient.common.utils for deprecation period. Change-Id: I5bd9579abc4e07f45219ccd0565626e6667472f7
* osc-lib: exceptionsDean Troyer2016-06-131-1/+1
| | | | | | | | Use osc-lib directly for exceptions. Leave openstackclient.common.exceptions for deprecation period. Change-Id: Iea3e862302372e1b31ccd27f69db59b4953ca828
* Add support for removing flavor-accessHuanxuan Ao2016-06-021-5/+47
| | | | | | | | Add "--project" and "--project-domain" options in "flavor unset" command to remove flavor access. Change-Id: Ia5c5a80d9890d5af066b75b4e202647c18c7d915 Partial-Bug: #1575461
* Add support for setting flavor-accessHuanxuan Ao2016-05-301-4/+48
| | | | | | | | This patch adds "--project" option in "flavor set" command to support for setting flavor access. Change-Id: I75b473600080d8ab1dd6ad01561c4f989ed3c3bd Partial-Bug: #1575461
* Fix i18n support for help and error messages in computeTang Chen2016-05-241-26/+30
| | | | | Change-Id: Id6eebcb48d1b7b49b6636524506294edbc44a83f Partial-bug: #1574965
* Make "flavor show" command to show a private flavor properlyHuanxuan Ao2016-05-021-8/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The "flavor show" command could not show a private flavor by flavor name becauce it could not find a private flavor by flavor name. In "until.find_resource(parsed_args.flavor)", If parsed_args.falvor is a name of a flavor, "flavors.find(name=parsed_args.flavor)"will be called to find a flavor.But the default value of "is_public" is "Ture" in "flavors.find()" so that we can only find public flavors.If we want to find all flaovrs by flavor name,we should add "is_public=None" in "flavors.find()". So I tried to change "until.find_resource(parsed_args.flavor)" to "until.find_resource(parsed_args.flavor, is_public=None)", but then I could not find any flavor by flavor id because "is_public" is an unexpected argument of "flavors.get()" in "until.find_resource()". In this case,I think "until.find_resource()" can not find a private flavor properly,and we should combine "manager.get(flavor.id)" and "manager.find(name=flavor.name, is_public=None)" by ourselve to find a flavor. Also,this bug affects other flavor commands like "flavor set/unset/delete",so I fix them in this patch too. Change-Id: I4a4ed7b0a2f522ee04d1c3270afcda7064285c39 Closes-Bug: #1575478
* Fix error in flavor set/unset commandHuanxuan Ao2016-04-281-2/+4
| | | | | | | | | | In the "flavor set/unset" command,the "flavor" parameter can be a name but can not be a id of a flavor. I think we should find a flavor by using "utils.find_resource()" in these commands. Change-Id: I5836788f7ed18813f1ebde31bb808b7c3f932b80 Closes-Bug: #1575624
* rxtx factor should be a floatSean Dague2016-04-041-3/+3
| | | | | | | The rxtx factor on compute flavors is a float in the API. OSC is currently blocking float values. Change-Id: Ifa9c14825f388d2821ff4b63ab8ae83fa9c8d88b
* Trivial: Reorder flavor op order in flavor.pyYang Hongyang2016-03-011-24/+24
| | | | | | Classes should be in alphabetical order. Change-Id: I7a35c3a2dd6d36c49f0d54dec5c14609a9168bd0
* Make SetFlavor and UnsetFlavor inherit from cliff.CommandTang Chen2016-02-271-18/+6
| | | | | | set/unset comamnd classes should inherit from cliff.Command class. Change-Id: I54e5608ac0768d7d94b7f7d516ea1948daefdc1b Partial-Bug: 1546065
* Fixed a bunch of spacingBrandon Palm2016-02-231-3/+3
| | | | | | | 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-6/+0
| | | | | | | | | | | | 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
* Set up logger of each command by metaclassAkihiro Motoki2016-01-201-22/+6
| | | | | | | compute.v2.flavor is changed in this commit as an initial example. Partial-Bug: #1532294 Change-Id: I262af6ade0ae03fbe1cd2ad198faf4ebb4ecf7ce
* Trivial: Remove useless return from files in compute.Tang Chen2015-12-171-1/+0
| | | | Change-Id: I9dc6749256fcd53d292d7f658912c032e9ce9df5
* Support pagination params for flavor listliyingjun2015-10-211-1/+12
| | | | | | | | Missing 'marker' and 'limit' params for `openstack flavor list` shell command. It would be nice to have this when there are many flavors. Closes-bug: #1505874 Change-Id: I088ac5d24f0d7595f5cbce14f063e296a449eb26
* Making --property as required when openstack flavor unsetjiaxi2015-07-181-0/+1
| | | | | | | | When using openstack flavor unset, the --property is needed, so the --property should be a required parameter. Close-Bug: #1474237 Change-Id: Id6913e1b263eddeb5dd44c3edb957206b68f816c
* Add the ability to set and unset flavor propertiesMarek Aufart2015-03-191-3/+75
| | | | | | | | | | Added flavor set and unset command which allow manage flavor properties called extra_specs. Command flavor show output was extended with these properties. Closes-Bug: 1434137 Change-Id: Ie469bade802de18aab9d58eda3fff46064008163
* Added capabilities/options to 'openstack flavor list'Igor_Bolotin2015-02-031-6/+52
| | | | | | | | | | | | | | | | | | | | | | command to match capabilities already provided by 'nova flavor-list': —public | --private | --all options allows to list public only (default), private only or all flavors. —long displays more field. This option also fetches properties (extra-specs) for each flavor using separate API call for each flavor and it’s too slow to be done by default. However as an administrator - sometimes I need to be able to see them for all flavors. Removed empty “Extra Specs” column as well as "Swap" and "RXTX Factor" from default output. DocImpact Closes-Bug: #1416780 Change-Id: I30cfa2c75e28daf17b936543a177c23ae1743c37
* Fine tune some of the helps commandsSteve Martinelli2015-01-131-1/+1
| | | | | | | | | try and add some consistency with the show and delete commands. replace 'show x' with 'display x' change 'delete a y' with just 'delete y' Change-Id: I47dfa8ee23ac5c41b355796415eb515155832f65
* Command docs: flavorDean Troyer2014-12-311-12/+19
| | | | Change-Id: Ie85ff7706ef08b70ab8ba99533465d90904cf393
* Normalize more help stringsDean Troyer2014-07-241-9/+14
| | | | Change-Id: I2b21bc904e35c1cc50da369d148e607fe3e8cf90