summaryrefslogtreecommitdiff
path: root/openstackclient/common/availability_zone.py
Commit message (Collapse)AuthorAgeFilesLines
* 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
* translate all command help strings3.4.0Steve Martinelli2016-11-171-1/+1
| | | | | | | | | | | | | | 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
* Remove execute permission on a few filesSongmingYan2016-07-221-0/+0
| | | | | | | Some files have execute permission unnecessarily. Change them from 755 to 644. Change-Id: I471ebd1c3d123ad4a7376f7f5996f53f8c2d9b0b
* Correct reraising of exceptionqinchunhua2016-07-071-2/+2
| | | | | | | | | When an exception was caught and rethrown, it should call 'raise' without any arguments because it shows the place where an exception occured initially instead of place where the exception re-raised. Change-Id: I5fb6dea5da7fb6e1e2b339a713c7d37f8c99e407
* Standardize logger usageTang Chen2016-06-201-8/+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: utilsDean Troyer2016-06-131-1/+1
| | | | | | | | Use osc-lib directly for utils. Leave openstackclient.common.utils for deprecation period. Change-Id: I5bd9579abc4e07f45219ccd0565626e6667472f7
* Fix i18n supports in commomHuanxuan Ao2016-06-071-3/+6
| | | | | | | | I checked all the files in openstackclient/common and fixed the missing i18n supprots. Change-Id: Id7f76a24aae663f5832ef9bcf1bd5a6b7081af24 Partial-bug: #1574965
* remove #noqa from i18n importsSteve Martinelli2016-05-131-1/+1
| | | | | | hacking checks no longer fail on `import _` Change-Id: Idd60f0a0e71e5081691eacb39e5091ab08fcce6d
* Refactor network AZ exception handlingRichard Theis2016-02-101-3/+2
| | | | | | | | Exceptions that occur while getting network availability zones should not be masked as if the extension does not exist. Change-Id: I07213ec6c4d83e97261b58bf8d42417c1cdfae6a Related-Bug: #1534202
* Support listing network availability zonesRichard Theis2016-02-021-10/+56
| | | | | | | | | | | | | | | | | | | | | | | Update the "os availability zone list" command to support listing network availability zones along with the currently listed compute and volume availability zones. This adds the --network option to the command in order to only list network availability zones. By default, all availability zones are listed. The --long option was also updated to include a "Zone Resource" column which is applicable to network availability zones. Example zone resources include "network" and "router". If the Network API does not support listing availability zones then a warning message will be issued when the --network option is specified. This support requires an updated release of the SDK in order to pull in [1]. [1] https://bugs.launchpad.net/python-openstacksdk/+bug/1532274 Change-Id: I78811d659b793d9d2111ea54665d5fe7e4887264 Closes-Bug: #1534202
* log take_action parameters in a single placeAkihiro Motoki2016-02-021-6/+2
| | | | | | | | | | | | 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
* Support listing volume availability zonesRichard Theis2016-01-141-14/+61
| | | | | | | | | | | | | | Update the "os availability zone list" command to support listing volume availability zones along with the currently listed compute availability zones. This adds a --compute and --volume option to the command in order to select the availability zones to list. By default, all availability zones are listed. If the Block Storage API does not support listing availability zones then an warning message will be issued. Change-Id: I8159509a41bd1fb1b4e77fdbb512cf64a5ac11a9 Closes-Bug: #1532945
* Refactor "os availability zone list"Richard Theis2016-01-141-0/+102
Refactor the "os availability zone list" command to make it a common command instead of a compute-only command. Since availability zones are common to compute, volume and network (new), this refactoring allows availability zone support to be added for volume and network. In addition to the refactor, unit and functional tests were added. Change-Id: I63e9d41d229b21cd38e5a083493042c096d65e05 Partial-Bug: #1532945