diff options
| author | Dean Troyer <dtroyer@gmail.com> | 2018-03-20 15:40:18 -0500 |
|---|---|---|
| committer | Dean Troyer <dtroyer@gmail.com> | 2018-03-20 15:40:23 -0500 |
| commit | 6df58b63667b3f7b76c7825f5204a6c4f531521c (patch) | |
| tree | 3ccdccac16b5665fcfd097ca976a9a354192db14 /openstackclient/compute/v2/usage.py | |
| parent | 9a173568548203757a7fd20883edd56f923cc7e8 (diff) | |
| download | python-openstackclient-6df58b63667b3f7b76c7825f5204a6c4f531521c.tar.gz | |
Fix additional output encoding issues
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
Diffstat (limited to 'openstackclient/compute/v2/usage.py')
| -rw-r--r-- | openstackclient/compute/v2/usage.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/openstackclient/compute/v2/usage.py b/openstackclient/compute/v2/usage.py index 3edcffe4..4320bf90 100644 --- a/openstackclient/compute/v2/usage.py +++ b/openstackclient/compute/v2/usage.py @@ -16,7 +16,6 @@ """Usage action implementations""" import datetime -import sys from osc_lib.command import command from osc_lib import utils @@ -96,7 +95,7 @@ class ListUsage(command.Lister): pass if parsed_args.formatter == 'table' and len(usage_list) > 0: - sys.stdout.write(_("Usage from %(start)s to %(end)s: \n") % { + self.app.stdout.write(_("Usage from %(start)s to %(end)s: \n") % { "start": start.strftime(dateformat), "end": end.strftime(dateformat), }) @@ -168,8 +167,9 @@ class ShowUsage(command.ShowOne): usage = compute_client.usage.get(project, start, end) if parsed_args.formatter == 'table': - sys.stdout.write(_("Usage from %(start)s to %(end)s on " - "project %(project)s: \n") % { + self.app.stdout.write(_( + "Usage from %(start)s to %(end)s on project %(project)s: \n" + ) % { "start": start.strftime(dateformat), "end": end.strftime(dateformat), "project": project, |
