since nova api 2.40 the os-simple-tenant-usage API supports pagination
and will by default return a number of entities configured internally in
Nova.
This means that when there are many enough projects,
the single call to usage.list() will not return usages for all projects.
This patch effectively copy-pastes the logic to paginate over usage list
results from novaclient/v2/shell.py code.
Change-Id: I1b639fe386b7b7db3223f6965495094b9d51533a
Story: #2005099
Task: #29713
This is a followup to https://review.openstack.org/#/c/541609/ that
changes most outstanding direct uses of sys.stdout to use the encoded
stdout set up by cliff.
Change-Id: I07cfc418385fc787d3b7d3c32d39676cf81bb91f
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
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
Remove the 'project usage list' command that was deprecated in version
1.0.2 in review Ie08d4f88d71a660fca1862405351109cd0aa86b6.
Note that the removed command class is a good example of how to wrap a
command and show a deprecation message.
Change-Id: I6c750730963615895f5d9953487d2d5a905885a8
When there is no resouce usage associated with the project,
an odd output will be displayed.
This patch tried to fix this issue.
Change-Id: I6f254c6ba37fbb760ada08e640c4938668d560dc
Closes-Bug: #1512220
Rather than pointing the 'project usage list' entry point directly to
ListUsage, this makes a ListProjectUsage subclass to alias the desired
command and still allow for changing behaviour or issuing a deprecation
messages. This implementation simply sets a new 'deprecated' attribute
in the command class that cliff will use to skip this command when
generating help output.
The actual skipping of the command in help output is dependant on
https://review.openstack.org/147349 merging in cliff, this review will
simply have no effect on help output until a version of cliff with
that update is present.
The deprecation message printed is somewhat generic until
https://review.openstack.org/147381 is merged in cliff.
Until that is merged, the deprecation message will not have the name
of the actual command given by the user in it, but rather the text
'this command'.
Closes-bug: #1406654
Change-Id: Ie08d4f88d71a660fca1862405351109cd0aa86b6
Should show basic usage by project id, if not specified then
use the project id the user is authN'ing with.
Change-Id: I0284a5efd84075b18e1a7117cc9f8f7fecf16274
Closes-Bug: #1400796
* Added number of servers column, was missing
* Added a new line character after the initial usage message
Change-Id: I6c4e5bda6ba9ceafa92ecf13987c56d0bbe99961
So we can update requriements.txt. But fix a couple of easy ones:
* Fix E251 (1 occurrance)
* Fix E131 (1 occurrance)
Change-Id: I62aaa423aa6da9e9f0ca026ec586b51cc6a6df03
There are files containing string format arguments inside
logging messages. Using logging function parameters should
be preferred.
Change-Id: Ic749ac9eb55564ed631d57055a5a4dfc3aebd169
This fixes some errors and inconsistencies I found reviewing the
help strings:
* Capitalize help strings
* Add missing space between words (in multi-line strings)
* Improve wording
Change-Id: I2fb31ab4191c330146e31c1a9651115a6657769a