From daf17225f8ab956c083dca7b0c770392677dcb5e Mon Sep 17 00:00:00 2001 From: Feng Shengqin Date: Mon, 5 Jun 2017 13:35:32 +0800 Subject: [PATCH] OSC: return columns instead of using print_dict Change-Id: Ia160e4f30c49bbaa1b80a1f591764e6d5a5ee1fb Closes-Bug: #1695791 --- zunclient/osc/v1/containers.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/zunclient/osc/v1/containers.py b/zunclient/osc/v1/containers.py index 6d637177..02d94f39 100644 --- a/zunclient/osc/v1/containers.py +++ b/zunclient/osc/v1/containers.py @@ -21,7 +21,6 @@ import time from osc_lib.command import command from osc_lib import utils -from zunclient.common import cliutils from zunclient.common import utils as zun_utils from zunclient.common.websocketclient import exceptions from zunclient.common.websocketclient import websocketclient @@ -87,7 +86,7 @@ class CreateContainer(command.ShowOne): 'It can have following values: ' '"ifnotpresent": only pull the image if it does not ' 'already exist on the node. ' - '"always": Always pull the image from repositery.' + '"always": Always pull the image from repository.' '"never": never pull the image') parser.add_argument( '--restart', @@ -551,7 +550,7 @@ class RunContainer(command.ShowOne): 'It can have following values: ' '"ifnotpresent": only pull the image if it does not ' 'already exist on the node. ' - '"always": Always pull the image from repositery.' + '"always": Always pull the image from repository.' '"never": never pull the image') parser.add_argument( '--restart', @@ -730,7 +729,7 @@ class AttachContainer(command.Command): parser.add_argument( 'container', metavar='', - help='ID or name of the container to be attahed to.') + help='ID or name of the container to be attached to.') return parser def take_action(self, parsed_args): @@ -794,7 +793,7 @@ class CopyContainer(command.Command): print("openstack appcontainer cp src_path|- container:dest_path") -class StatsContainer(command.Command): +class StatsContainer(command.ShowOne): """Display stats of the container.""" log = logging.getLogger(__name__ + ".StatsContainer") @@ -810,7 +809,7 @@ class StatsContainer(command.Command): client = _get_client(self, parsed_args) container = parsed_args.container stats_info = client.containers.stats(container) - cliutils.print_dict(stats_info) + return stats_info.keys(), stats_info.values() class CommitContainer(command.Command):