From f8a0f4025853fffaa4e38f0491e8c7712671ad7b Mon Sep 17 00:00:00 2001 From: tengqm Date: Mon, 26 Jan 2015 17:32:54 +0800 Subject: [PATCH] Basic support for cluster show --- senlinclient/v1/shell.py | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/senlinclient/v1/shell.py b/senlinclient/v1/shell.py index 16805a7a..c87660fb 100644 --- a/senlinclient/v1/shell.py +++ b/senlinclient/v1/shell.py @@ -346,16 +346,13 @@ def do_cluster_show(sc, args): query = {'id': args.id} cluster = sc.get(models.Cluster, query) except exc.HTTPNotFound: - raise exc.CommandError(_('Cluster not found: %s') % args.id) - else: - formatters = { - 'profile': utils.json_formatter, - 'status': utils.text_wrap_formatter, - 'status_reason': utils.text_wrap_formatter, - 'tags': utils.json_formatter, - 'links': utils.link_formatter - } - utils.print_dict(cluster.to_dict(), formatters=formatters) + raise exc.CommandError(_('Cluster %s is not found') % args.id) + + formatters = { + 'tags': utils.json_formatter, + 'nodes': utils.list_formatter, + } + utils.print_dict(cluster.to_dict(), formatters=formatters) @utils.arg('-s', '--show-deleted', default=False, action="store_true",