From 0a8fa962c4ddbb7f4a02868738f10aab97c21830 Mon Sep 17 00:00:00 2001 From: chohoor Date: Fri, 26 May 2017 17:29:37 +0800 Subject: [PATCH] remove redundant value when cluster-show cluster-show command returned a redundant value named is_profile_only, this path removed the redundant value because it is not a attr belong to cluster. Change-Id: Ic11d0b8ea8eb07a0bbe3b3e125b1ba7d34663784 Closes-Bug: #1693156 --- senlinclient/v1/cluster.py | 2 ++ senlinclient/v1/shell.py | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/senlinclient/v1/cluster.py b/senlinclient/v1/cluster.py index 1d62c3e..4ad1229 100644 --- a/senlinclient/v1/cluster.py +++ b/senlinclient/v1/cluster.py @@ -144,6 +144,8 @@ def _show_cluster(senlin_client, cluster_id): 'node_ids': senlin_utils.list_formatter } data = cluster.to_dict() + if 'is_profile_only' in data: + data.pop('is_profile_only') columns = sorted(data.keys()) return columns, utils.get_dict_properties(data, columns, formatters=formatters) diff --git a/senlinclient/v1/shell.py b/senlinclient/v1/shell.py index 99702b6..0e5574d 100644 --- a/senlinclient/v1/shell.py +++ b/senlinclient/v1/shell.py @@ -552,7 +552,9 @@ def _show_cluster(service, cluster_id): 'metadata': utils.json_formatter, 'node_ids': utils.list_formatter, } - utils.print_dict(cluster.to_dict(), formatters=formatters) + cluster_attrs = cluster.to_dict() + cluster_attrs.pop('is_profile_only') + utils.print_dict(cluster_attrs, formatters=formatters) @utils.arg('-p', '--profile', metavar='', required=True,