From 69ba1c6d26074a1ecc38d5b5cfa20cc133195691 Mon Sep 17 00:00:00 2001 From: tengqm Date: Sun, 31 Jul 2016 22:08:48 -0400 Subject: [PATCH] Fix nodes display in cluster-show This patch fixes the problem caused by latest changes to openstacksdk where 'nodes' was changed to 'node_ids'. Closes-Bug: 1608325 Change-Id: Ie68a3af9103343b2e314d2e90d5b067cf3b8ed81 --- senlinclient/tests/unit/v1/test_cluster.py | 8 ++++---- senlinclient/tests/unit/v1/test_shell.py | 2 +- senlinclient/v1/cluster.py | 2 +- senlinclient/v1/shell.py | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/senlinclient/tests/unit/v1/test_cluster.py b/senlinclient/tests/unit/v1/test_cluster.py index fc8621e..3bba71f 100644 --- a/senlinclient/tests/unit/v1/test_cluster.py +++ b/senlinclient/tests/unit/v1/test_cluster.py @@ -43,7 +43,7 @@ class TestClusterList(TestCluster): "metadata": {}, "min_size": 0, "name": "cluster1", - "nodes": [ + "node_ids": [ "b07c57c8-7ab2-47bf-bdf8-e894c0c601b9", "ecc23d3e-bb68-48f8-8260-c9cf6bcb6e61", "da1e9c87-e584-4626-a120-022da5062dac" @@ -158,7 +158,7 @@ class TestClusterShow(TestCluster): "metadata": {}, "min_size": 0, "name": "my_cluster", - "nodes": [], + "node_ids": [], "policies": [], "profile_id": "edc63d0a-2ca4-48fa-9854-27926da76a4a", "profile_name": "mystack", @@ -204,7 +204,7 @@ class TestClusterCreate(TestCluster): "metadata": {}, "min_size": 0, "name": "test_cluster", - "nodes": [], + "node_ids": [], "policies": [], "profile_id": "edc63d0a-2ca4-48fa-9854-27926da76a4a", "profile_name": "mystack", @@ -274,7 +274,7 @@ class TestClusterUpdate(TestCluster): "metadata": {}, "min_size": 0, "name": "test_cluster", - "nodes": [], + "node_ids": [], "policies": [], "profile_id": "edc63d0a-2ca4-48fa-9854-27926da76a4a", "profile_name": "mystack", diff --git a/senlinclient/tests/unit/v1/test_shell.py b/senlinclient/tests/unit/v1/test_shell.py index 48e3356..b5cc399 100644 --- a/senlinclient/tests/unit/v1/test_shell.py +++ b/senlinclient/tests/unit/v1/test_shell.py @@ -637,7 +637,7 @@ class ShellTest(testtools.TestCase): service.get_cluster.return_value = cluster formatters = { 'metadata': utils.json_formatter, - 'nodes': utils.list_formatter, + 'node_ids': utils.list_formatter, } cluster_dict = mock.Mock() cluster.to_dict.return_value = cluster_dict diff --git a/senlinclient/v1/cluster.py b/senlinclient/v1/cluster.py index bd803b4..5a3a52f 100644 --- a/senlinclient/v1/cluster.py +++ b/senlinclient/v1/cluster.py @@ -133,7 +133,7 @@ def _show_cluster(senlin_client, cluster_id): formatters = { 'metadata': senlin_utils.json_formatter, - 'nodes': senlin_utils.list_formatter + 'node_ids': senlin_utils.list_formatter } data = cluster.to_dict() columns = sorted(list(six.iterkeys(data))) diff --git a/senlinclient/v1/shell.py b/senlinclient/v1/shell.py index ca2b372..4734ad7 100644 --- a/senlinclient/v1/shell.py +++ b/senlinclient/v1/shell.py @@ -449,7 +449,7 @@ def _show_cluster(service, cluster_id): formatters = { 'metadata': utils.json_formatter, - 'nodes': utils.list_formatter, + 'node_ids': utils.list_formatter, } utils.print_dict(cluster.to_dict(), formatters=formatters)